lkml.org 
[lkml]   [2003]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] sysfs -- don't crash if removing non-existant attribute group
Some (buggy) network drivers in 2.6 decide to set the statistics hook,
after registration. This causes unregister_netdevice to crash because it attempts
to remove the 'statistics' attribute group it thought was created.

This fixes sysfs so it ignores the problem. Another set of patches
will address the remaining buggy ether drivers.

diff -Nru a/fs/sysfs/group.c b/fs/sysfs/group.c
--- a/fs/sysfs/group.c Mon Oct 13 16:04:31 2003
+++ b/fs/sysfs/group.c Mon Oct 13 16:04:31 2003
@@ -65,9 +65,11 @@
{
struct dentry * dir;

- if (grp->name)
+ if (grp->name) {
dir = sysfs_get_dentry(kobj->dentry,grp->name);
- else
+ if (dir == NULL) /* non-existent */
+ return;
+ } else
dir = kobj->dentry;

remove_files(dir,grp);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.037 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site