aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 6a06a1d1ea7b..0d09f6c6efab 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -111,20 +111,20 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
111 if (!sd) 111 if (!sd)
112 return -EINVAL; 112 return -EINVAL;
113 113
114 mutex_lock(&sysfs_mutex);
114 error = inode_change_ok(inode, iattr); 115 error = inode_change_ok(inode, iattr);
115 if (error) 116 if (error)
116 return error; 117 goto out;
117 118
118 iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */ 119 iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */
119 120
120 error = inode_setattr(inode, iattr); 121 error = inode_setattr(inode, iattr);
121 if (error) 122 if (error)
122 return error; 123 goto out;
123 124
124 mutex_lock(&sysfs_mutex);
125 error = sysfs_sd_setattr(sd, iattr); 125 error = sysfs_sd_setattr(sd, iattr);
126out:
126 mutex_unlock(&sysfs_mutex); 127 mutex_unlock(&sysfs_mutex);
127
128 return error; 128 return error;
129} 129}
130 130