diff options
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 16f39c30b091..ff93c92164b3 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -470,7 +470,9 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr) | |||
470 | if (!victim_sd) | 470 | if (!victim_sd) |
471 | goto out; | 471 | goto out; |
472 | 472 | ||
473 | mutex_lock(&sysfs_rename_mutex); | ||
473 | victim = sysfs_get_dentry(victim_sd); | 474 | victim = sysfs_get_dentry(victim_sd); |
475 | mutex_unlock(&sysfs_rename_mutex); | ||
474 | if (IS_ERR(victim)) { | 476 | if (IS_ERR(victim)) { |
475 | rc = PTR_ERR(victim); | 477 | rc = PTR_ERR(victim); |
476 | victim = NULL; | 478 | victim = NULL; |
@@ -509,7 +511,9 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) | |||
509 | if (!victim_sd) | 511 | if (!victim_sd) |
510 | goto out; | 512 | goto out; |
511 | 513 | ||
514 | mutex_lock(&sysfs_rename_mutex); | ||
512 | victim = sysfs_get_dentry(victim_sd); | 515 | victim = sysfs_get_dentry(victim_sd); |
516 | mutex_unlock(&sysfs_rename_mutex); | ||
513 | if (IS_ERR(victim)) { | 517 | if (IS_ERR(victim)) { |
514 | rc = PTR_ERR(victim); | 518 | rc = PTR_ERR(victim); |
515 | victim = NULL; | 519 | victim = NULL; |