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] [day] [month] [year] [list]
Message-ID: <YR59CnAXhzECKF3s@smile.fi.intel.com>
Date:   Thu, 19 Aug 2021 18:47:22 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Mihai Carabas <mihai.carabas@...cle.com>
Cc:     arnd@...db.de, gregkh@...uxfoundation.org,
        christophe.jaillet@...adoo.fr, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] misc/pvpanic: fix set driver data

On Thu, Aug 19, 2021 at 04:41:21PM +0300, Mihai Carabas wrote:
> Add again dev_set_drvdata(), but this time in devm_pvpanic_probe(), in order
> for dev_get_drvdata() to not return NULL.

Thanks, almost good, after addressing below feel free to add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

> Fixes: 394febc9d0a6 ("misc/pvpanic: Make 'pvpanic_probe()' resource managed")
> Signed-off-by: Mihai Carabas <mihai.carabas@...cle.com>
> ---
>  drivers/misc/pvpanic/pvpanic.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
> index 02b807c..6ce48ce 100644
> --- a/drivers/misc/pvpanic/pvpanic.c
> +++ b/drivers/misc/pvpanic/pvpanic.c
> @@ -81,6 +81,8 @@ int devm_pvpanic_probe(struct device *dev, struct pvpanic_instance *pi)
>  	if (!pi || !pi->base)
>  		return -EINVAL;

> +	dev_set_drvdata(dev, pi);

I believe this should be last (or close enough) operation in the function for
the sake of logical flow.

>  	spin_lock(&pvpanic_lock);
>  	list_add(&pi->list, &pvpanic_list);
>  	spin_unlock(&pvpanic_lock);

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ