diff options
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 6beee6f6a674..4c29ac41ac3e 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -54,11 +54,10 @@ int sysfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
54 | 54 | ||
55 | if (!sd_iattr) { | 55 | if (!sd_iattr) { |
56 | /* setting attributes for the first time, allocate now */ | 56 | /* setting attributes for the first time, allocate now */ |
57 | sd_iattr = kmalloc(sizeof(struct iattr), GFP_KERNEL); | 57 | sd_iattr = kzalloc(sizeof(struct iattr), GFP_KERNEL); |
58 | if (!sd_iattr) | 58 | if (!sd_iattr) |
59 | return -ENOMEM; | 59 | return -ENOMEM; |
60 | /* assign default attributes */ | 60 | /* assign default attributes */ |
61 | memset(sd_iattr, 0, sizeof(struct iattr)); | ||
62 | sd_iattr->ia_mode = sd->s_mode; | 61 | sd_iattr->ia_mode = sd->s_mode; |
63 | sd_iattr->ia_uid = 0; | 62 | sd_iattr->ia_uid = 0; |
64 | sd_iattr->ia_gid = 0; | 63 | sd_iattr->ia_gid = 0; |