projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8218ef8
)
[PATCH] sysfs: handle failures in sysfs_make_dirent
author
Steven Rostedt
<rostedt@goodmis.org>
Wed, 23 Nov 2005 14:15:44 +0000
(09:15 -0500)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Thu, 5 Jan 2006 00:18:09 +0000
(16:18 -0800)
I noticed that if sysfs_make_dirent fails to allocate the sd, then a
null will be passed to sysfs_put.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/dir.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/sysfs/dir.c
b/fs/sysfs/dir.c
index 59734ba1ee6026556af405cfe77a6bf21f30084e..d367803821760883ce6d1043ef7aec5c470145f9 100644
(file)
--- a/
fs/sysfs/dir.c
+++ b/
fs/sysfs/dir.c
@@
-112,7
+112,11
@@
static int create_dir(struct kobject * k, struct dentry * p,
}
}
if (error && (error != -EEXIST)) {
- sysfs_put((*d)->d_fsdata);
+ struct sysfs_dirent *sd = (*d)->d_fsdata;
+ if (sd) {
+ list_del_init(&sd->s_sibling);
+ sysfs_put(sd);
+ }
d_drop(*d);
}
dput(*d);