From: Sasikantha babu <sasikanth.v19@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Sasikantha babu <sasikanth.v19@gmail.com>
Subject: [PATCH v2] sysfs: Removed dup_name entirely in sysfs_rename
Date: Mon, 30 Apr 2012 15:16:56 +0530 [thread overview]
Message-ID: <1335779216-32068-1-git-send-email-sasikanth.v19@gmail.com> (raw)
Since no one using "dup_name", removed it completely in sysfs_rename,
Signed-off-by: Sasikantha babu <sasikanth.v19@gmail.com>
---
fs/sysfs/dir.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 35a36d3..24fa995 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -858,7 +858,6 @@ int sysfs_rename(struct sysfs_dirent *sd,
struct sysfs_dirent *new_parent_sd, const void *new_ns,
const char *new_name)
{
- const char *dup_name = NULL;
int error;
mutex_lock(&sysfs_mutex);
@@ -875,11 +874,11 @@ 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;
- dup_name = sd->s_name;
+ kfree(sd->s_name);
sd->s_name = new_name;
}
@@ -895,7 +894,6 @@ int sysfs_rename(struct sysfs_dirent *sd,
error = 0;
out:
mutex_unlock(&sysfs_mutex);
- kfree(dup_name);
return error;
}
--
1.7.3.4
next reply other threads:[~2012-04-30 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 9:46 Sasikantha babu [this message]
2012-04-30 13:51 ` Greg Kroah-Hartman
2012-05-01 11:07 ` Sasikanth babu
2012-05-02 20:10 ` Greg Kroah-Hartman
2012-05-02 20:54 ` Sasikanth babu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1335779216-32068-1-git-send-email-sasikanth.v19@gmail.com \
--to=sasikanth.v19@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome