Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304069
b: refs/heads/master
c: b4eafca
h: refs/heads/master
i:
  304067: 32db99b
v: v3
  • Loading branch information
Sasikantha babu authored and Greg Kroah-Hartman committed May 2, 2012
1 parent 800427b commit 7667daf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb1574270a6de8fb8d31ffc3b021e30df0afcda3
refs/heads/master: b4eafca1132d6065c2f37a873dbf4e0bb88cb23f
6 changes: 2 additions & 4 deletions trunk/fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand All @@ -895,7 +894,6 @@ int sysfs_rename(struct sysfs_dirent *sd,
error = 0;
out:
mutex_unlock(&sysfs_mutex);
kfree(dup_name);
return error;
}

Expand Down

0 comments on commit 7667daf

Please sign in to comment.