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: <20131203024726.GC23997@kroah.com>
Date:	Mon, 2 Dec 2013 18:47:26 -0800
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Rui Xiang <rui.xiang@...wei.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sysfs: add necessary Null check in
 sysfs_do_create_link_sd

On Tue, Dec 03, 2013 at 09:38:47AM +0800, Rui Xiang wrote:
> While target_sd or sd are null, it won't need sysfs_put and
> should return -ENOENT directly. Here add null check for
> target_sd and sd.
> 
> Signed-off-by: Rui Xiang <rui.xiang@...wei.com>
> ---
>  fs/sysfs/symlink.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
> index 3ae3f1b..d69b786 100644
> --- a/fs/sysfs/symlink.c
> +++ b/fs/sysfs/symlink.c
> @@ -83,8 +83,10 @@ static int sysfs_do_create_link_sd(struct sysfs_dirent *parent_sd,
>  	return 0;
>  
>   out_put:
> -	sysfs_put(target_sd);
> -	sysfs_put(sd);
> +	if (target_sd)
> +		sysfs_put(target_sd);
> +	if (sd)
> +		sysfs_put(sd);

This change does nothing at all, why is it needed?

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ