Missing kobject release methods?

From: Alan Stern
Date: Mon Oct 27 2003 - 11:32:39 EST


Greg:

For a long time, I've been getting debug warnings about missing release()
methods in various kobjects. They come up because your usb-2.5 tree has
DEBUG defined in a number of driver-model source files.

It's not easy to track down exactly what the objects in question are; the
driver-model/kobject system is a pretty tangled web of pointers and
subobjects. I suspect the objects in question are actually embedded as
sub-structures of other things that do get released correctly, so these
messages may be completely safe to ignore. But it would be better if they
weren't generated in the first place, because they fill up my system logs
and debugging screens with stack dumps.

The kobjects and subroutines that provoke these messages are:

usb in usb_major_cleanup()
usb_host in usb_host_cleanup()
drivers in bus_unregister()
devices in bus_unregister()
usb in usb_exit()
class_obj in usb_host_release()

To see for yourself, try rmmod'ing a USB device driver module and the
usbcore module.

It oculd be that fixing this will be as simple as initializing a .release
method with a pointer to a function that does nothing in some place like
lib/kobject.c:kset_init(). But I don't pretend to understand the details
of kobjects and such well enough to really track this down. Maybe you
can.

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/