* [PATCH] fix sysfs oops [1/4]
@ 2003-12-23 0:24 Greg KH
0 siblings, 0 replies; only message in thread
From: Greg KH @ 2003-12-23 0:24 UTC (permalink / raw)
To: linux-hotplug
This fixes an oops when a kobject is unregistered before it's child is.
The usb-serial devices show this bug very easily (yank out a device
while its port is opened...)
Patch was originally written by Mike Gorse <mgorse@mgorse.dhs.org>
diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c Mon Dec 22 16:02:07 2003
+++ b/fs/sysfs/dir.c Mon Dec 22 16:02:07 2003
@@ -83,7 +83,8 @@
struct dentry * parent = dget(d->d_parent);
down(&parent->d_inode->i_sem);
d_delete(d);
- simple_rmdir(parent->d_inode,d);
+ if (d->d_inode)
+ simple_rmdir(parent->d_inode,d);
pr_debug(" o %s removing done (%d)\n",d->d_name.name,
atomic_read(&d->d_count));
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-12-23 0:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23 0:24 [PATCH] fix sysfs oops [1/4] Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).