diff options
Diffstat (limited to 'fs/sysfs/symlink.c')
-rw-r--r-- | fs/sysfs/symlink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index b463f17f6638..d96bb9cbc9d4 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -49,6 +49,7 @@ static int sysfs_add_link(struct dentry * parent, const char * name, struct kobj | |||
49 | { | 49 | { |
50 | struct sysfs_dirent * parent_sd = parent->d_fsdata; | 50 | struct sysfs_dirent * parent_sd = parent->d_fsdata; |
51 | struct sysfs_symlink * sl; | 51 | struct sysfs_symlink * sl; |
52 | struct sysfs_dirent * sd; | ||
52 | int error; | 53 | int error; |
53 | 54 | ||
54 | error = -ENOMEM; | 55 | error = -ENOMEM; |
@@ -63,10 +64,10 @@ static int sysfs_add_link(struct dentry * parent, const char * name, struct kobj | |||
63 | strcpy(sl->link_name, name); | 64 | strcpy(sl->link_name, name); |
64 | sl->target_kobj = kobject_get(target); | 65 | sl->target_kobj = kobject_get(target); |
65 | 66 | ||
66 | error = sysfs_make_dirent(parent_sd, NULL, sl, S_IFLNK|S_IRWXUGO, | 67 | sd = sysfs_new_dirent(sl, S_IFLNK|S_IRWXUGO, SYSFS_KOBJ_LINK); |
67 | SYSFS_KOBJ_LINK); | 68 | if (!sd) |
68 | if (error) | ||
69 | goto err_out; | 69 | goto err_out; |
70 | sysfs_attach_dirent(sd, parent_sd, NULL); | ||
70 | 71 | ||
71 | return 0; | 72 | return 0; |
72 | 73 | ||