diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 21:28:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-18 21:28:08 -0400 |
commit | 29e7ee378e2327c808ede66dec4d4d964f4d375f (patch) | |
tree | 4f904bfc485acd2ba5f7abdf43f57eeb8ce1dbdb /fs/sysfs/symlink.c | |
parent | fc15bc817eecd5c13581adab2a182c07edededa0 (diff) | |
parent | 967e35dcc9ac194b4a6fad69a5a51f93d69bb0d1 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
sysfs: cosmetic clean up on node creation failure paths
sysfs: kill an extra put in sysfs_create_link() failure path
Driver core: check return code of sysfs_create_link()
HOWTO: Add the knwon_regression URI to the documentation
dev_vdbg() documentation
dev_vdbg(), available with -DVERBOSE_DEBUG
sysfs: make sysfs_init_inode() static
sysfs: fix sysfs root inode nlink accounting
Documentation fix devres.txt: lib/iomap.c -> lib/devres.c
sysfs: avoid kmem_cache_free(NULL)
PM: remove deprecated dpm_runtime_* routines
PM: Remove deprecated sysfs files
Driver core: accept all valid action-strings in uevent-trigger
debugfs: remove rmdir() non-empty complaint
Diffstat (limited to 'fs/sysfs/symlink.c')
-rw-r--r-- | fs/sysfs/symlink.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index 2f86e0422290..4ce687f0b5d0 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c | |||
@@ -86,7 +86,9 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, const char | |||
86 | sd = sysfs_new_dirent(name, S_IFLNK|S_IRWXUGO, SYSFS_KOBJ_LINK); | 86 | sd = sysfs_new_dirent(name, S_IFLNK|S_IRWXUGO, SYSFS_KOBJ_LINK); |
87 | if (!sd) | 87 | if (!sd) |
88 | goto out_put; | 88 | goto out_put; |
89 | |||
89 | sd->s_elem.symlink.target_sd = target_sd; | 90 | sd->s_elem.symlink.target_sd = target_sd; |
91 | target_sd = NULL; /* reference is now owned by the symlink */ | ||
90 | 92 | ||
91 | sysfs_addrm_start(&acxt, parent_sd); | 93 | sysfs_addrm_start(&acxt, parent_sd); |
92 | 94 | ||
@@ -95,11 +97,13 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, const char | |||
95 | sysfs_link_sibling(sd); | 97 | sysfs_link_sibling(sd); |
96 | } | 98 | } |
97 | 99 | ||
98 | if (sysfs_addrm_finish(&acxt)) | 100 | if (!sysfs_addrm_finish(&acxt)) { |
99 | return 0; | 101 | error = -EEXIST; |
102 | goto out_put; | ||
103 | } | ||
104 | |||
105 | return 0; | ||
100 | 106 | ||
101 | error = -EEXIST; | ||
102 | /* fall through */ | ||
103 | out_put: | 107 | out_put: |
104 | sysfs_put(target_sd); | 108 | sysfs_put(target_sd); |
105 | sysfs_put(sd); | 109 | sysfs_put(sd); |