lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Jul 2022 20:49:34 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kent Gibson <warthog618@...il.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Stable <stable@...r.kernel.org>
Subject: Re: [PATCH] gpio: sim: fix the chip_name configfs item

On Mon, Jul 11, 2022 at 7:35 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> The chip_name configs attribute always displays the device name of the
> first GPIO bank because the logic of the relevant function is simply
> wrong.
>
> Fix it by correctly comparing the bank's swnode against the GPIO
> device's children.
>
> Fixes: cb8c474e79be ("gpio: sim: new testing module")
> Cc: stable@...r.kernel.org
> Reported-by: Kent Gibson <warthog618@...il.com>
> Signed-off-by: Bartosz Golaszewski <brgl@...ev.pl>

...

>  struct gpio_sim_chip_name_ctx {
> -       struct gpio_sim_device *dev;
> +       struct fwnode_handle *swnode;

I would call it fwnode even if we know the backend provider.

>         char *page;
>  };

...

>         struct fwnode_handle *swnode;

Do you still need this? See below.

...

>         swnode = dev_fwnode(dev);
>
> +       if (swnode == ctx->swnode)
> +               return sprintf(ctx->page, "%s\n", dev_name(dev));

So, now it can be

if (device_match_fwnode(dev, ctx->fwnode))
  return sprintf(...);

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ