Re: usb unbind/bind => WARNING at fs/sysfs/dir.c [Was: 2.6.25-rc8-mm1]

From: Alan Stern
Date: Sat Apr 05 2008 - 10:16:31 EST


On Fri, 4 Apr 2008, Greg KH wrote:

> > Here's the answer. The bug was introduced when the definition of
> > device_is_registered() in include/linux/device.h was changed. The old
> > definition returned 0 when called inside a driver's remove method for a
> > device being unregistered, whereas the new definition returns 1. I
> > don't know when this change was made.
>
> I've changed that in the -mm tree to make some PCI stuff much easier. I
> didn't realize that USB was depending on when this was being set, sorry
> about it.
>
> I like your fix better, it makes the code path much simpler :)

Well, it's not really any _simpler_, since all I did was interchange
two lines of code.

But I agree this way is better. It doesn't depend on the behavior of
device_is_registered() in the ill-defined situation where the device is
in the middle of being unregistered.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/