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]
Date:   Thu, 8 Mar 2018 07:11:49 +0100
From:   Michael Büsch <m@...s.ch>
To:     Arvind Yadav <arvind.yadav.cs@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org
Subject: Re: [PATCH v2] ssb: use put_device() if device_register fail

On Thu,  8 Mar 2018 10:39:49 +0530
Arvind Yadav <arvind.yadav.cs@...il.com> wrote:

> Never directly free @dev after calling device_register(), even
> if it returned an error! Always use put_device() to give up the
> reference initialized.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
> changes in v2:
>              Removed kfree() call for @dev.
> 
>  drivers/ssb/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
> index 65420a9..a7a062b 100644
> --- a/drivers/ssb/main.c
> +++ b/drivers/ssb/main.c
> @@ -521,8 +521,8 @@ static int ssb_devices_register(struct ssb_bus *bus)
>  			ssb_err("Could not register %s\n", dev_name(dev));
>  			/* Set dev to NULL to not unregister
>  			 * dev on error unwinding. */
> +			put_device(dev);
>  			sdev->dev = NULL;
> -			kfree(devwrap);
>  			goto error;
>  		}
>  		dev_idx++;


Would you please put the put_device where the kfree was?
So that the comment still matches.
Thanks.


-- 
Michael

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ