Commit b7e72582 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix sysfs oops

From: Greg KH <greg@kroah.com>

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>
parent dc8d3e60
......@@ -83,7 +83,8 @@ static void remove_dir(struct dentry * d)
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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment