On Wed, 17 Nov 2021 01:21:55 +0100 Tomasz Duszynski <[email protected]> wrote:
> +static int
> +cnxk_gpio_open_mem(void)
> +{
> + int ret = 0, fd;
> +
> + fd = open("/dev/mem", O_RDWR | O_SYNC);
> + if (fd < 0)
> + ret = -errno;
> +
> + return ret;
> +}
This is a dangerous security violation and most distributions
will not allow it.
Also, why are you opening it? The code is forgetting the file
descriptor so it is useless anyway.

