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]
Message-ID: <ZOdSudrhg/9u3a9N@fedora>
Date:   Thu, 24 Aug 2023 14:53:13 +0200
From:   Martin Zaťovič <m.zatovic1@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
        linus.walleij@...aro.org, quic_jhugo@...cinc.com,
        nipun.gupta@....com, tzimmermann@...e.de, ogabbay@...nel.org,
        mathieu.poirier@...aro.org, axboe@...nel.dk,
        damien.lemoal@...nsource.wdc.com, linux@...y.sk, arnd@...db.de,
        yangyicong@...ilicon.com, benjamin.tissoires@...hat.com,
        masahiroy@...nel.org, jacek.lawrynowicz@...ux.intel.com,
        geert+renesas@...der.be, devicetree@...r.kernel.org,
        andriy.shevchenko@...el.com
Subject: Re: [PATCHv5 2/4] wiegand: add Wiegand bus driver

On Thu, Aug 24, 2023 at 01:40:35PM +0200, Greg KH wrote:
> On Thu, Aug 24, 2023 at 01:10:13PM +0200, Martin Zaťovič wrote:
> > +static inline void wiegand_controller_put(void *ptr)
> 
> Why is this a void *?  It should be "struct wiegand_controller *"

It is a void* because it is being passed to devm_add_action_or_reset()
and this function only accepts a pointer to a function that accepts a void*
parameter. I am not sure if there is a way around it.

> 
> Please never use void * if at all possible.
> 
> > +static inline void wiegand_unregister_driver(struct wiegand_driver *wdrv)
> > +{
> > +	if (wdrv)
> 
> How could this ever be true?
> 
> > +		driver_unregister(&wdrv->driver);
> > +}
> > +
> > +static inline struct wiegand_driver *to_wiegand_driver(struct device_driver *drv)
> > +{
> > +	return drv ? container_of(drv, struct wiegand_driver, driver) : NULL;
> 
> How could drv be NULL?
> 
> And you should make this a const *, right?

Will fix the other issues. Thank you!

> 
> thanks,
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ