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: <20120430015531.GA13098@kroah.com>
Date:	Sun, 29 Apr 2012 21:55:31 -0400
From:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:	Sasikantha babu <sasikanth.v19@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sysfs: Redundant assignment of dup_name in sysfs_rename

On Fri, Apr 27, 2012 at 08:01:02PM +0530, Sasikantha babu wrote:
> It is redundant to assign "kstrdup" of "new_value" to "dup_name",
> Since we are overwriting "dup_name" with "sd->s_name"
> 
> Signed-off-by: Sasikantha babu <sasikanth.v19@...il.com>
> ---
>  fs/sysfs/dir.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
> index 35a36d3..4abd424 100644
> --- a/fs/sysfs/dir.c
> +++ b/fs/sysfs/dir.c
> @@ -875,7 +875,7 @@ int sysfs_rename(struct sysfs_dirent *sd,
>  	/* rename sysfs_dirent */
>  	if (strcmp(sd->s_name, new_name) != 0) {
>  		error = -ENOMEM;
> -		new_name = dup_name = kstrdup(new_name, GFP_KERNEL);
> +		new_name = kstrdup(new_name, GFP_KERNEL);
>  		if (!new_name)
>  			goto out;

Why not get rid of dup_name entirely now as it really isn't used at all?
That would make a more "complete" patch, care to redo this?

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