* [PATCH] sysfs -- don't crash if removing non-existant attribute group
[not found] <20031003224931.57ac536a.davem@redhat.com>
@ 2003-10-13 23:25 ` Stephen Hemminger
2003-10-14 17:38 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-10-13 23:25 UTC (permalink / raw)
To: Patrick Mochel; +Cc: David S. Miller, Martin Josefsson, linux-kernel
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] sysfs -- don't crash if removing non-existant attribute group
2003-10-13 23:25 ` [PATCH] sysfs -- don't crash if removing non-existant attribute group Stephen Hemminger
@ 2003-10-14 17:38 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-10-14 17:38 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: mochel, gandalf, linux-kernel
On Mon, 13 Oct 2003 16:25:59 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:
> This fixes sysfs so it ignores the problem. Another set of patches
> will address the remaining buggy ether drivers.
Please change this patch to add a net_ratelimit()'d warning message so
that we can catch new instances of this problem.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-10-14 17:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20031003224931.57ac536a.davem@redhat.com>
2003-10-13 23:25 ` [PATCH] sysfs -- don't crash if removing non-existant attribute group Stephen Hemminger
2003-10-14 17:38 ` David S. Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.