The struct device embedded within a struct usb_interface is initialized as soon as the structure is allocated, so that when put_device() is called it will contain valid data.
put_device() is not called for unallocated interfaces.
Sounds related to something I recently ran into. Basically,
# cd /sys/bus/usb/devices/.../ # echo 2 > bConfigurationValue # echo 3 > bConfigurationValue # echo 2 > bConfigurationValue # echo 3 > bConfigurationValue # echo 2 > bConfigurationValue ... then a kernel oops blew bash (and its window!) away
The first oops stopped with this kobject_add() patch, but it didn't affect some slab corruption oopses. Basically I had to conclude there was a pre-existing problem in how usb talks to sysfs -- maybe one of those you just found! :)
It'll be interesting to see if your patch helps.
- Dave
--- 1.29/lib/kobject.c Tue Sep 2 14:30:54 2003
+++ edited/lib/kobject.c Mon Sep 15 12:27:38 2003
@@ -263,6 +263,7 @@
kobj->kset ? kobj->kset->kobj.name : "<NULL>" ); if (kobj->kset) {
+if (kobj->kset->subsys) {
down_write(&kobj->kset->subsys->rwsem);if (!parent) @@ -270,6 +271,8 @@
list_add_tail(&kobj->entry,&kobj->kset->list);
up_write(&kobj->kset->subsys->rwsem);
+} else printk(KERN_DEBUG "%s %s, no subsys??\n",
+ __FUNCTION__, kobject_name(kobj));
}
kobj->parent = parent;(surely the mailer trashed that patch ... )
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
