[openib-general] [PATCH] Basic driver model/sysfs support

Roland Dreier roland at topspin.com
Thu Sep 2 15:18:09 PDT 2004


    Krishna> Looks like kfree(device) is missing after
    Krishna> ib_device_deregister_sysfs.  Maybe it can be at a label
    Krishna> at the end, which the top code can jump to if the device
    Krishna> state is uninitialized.

This is intentional -- ib_device_deregister_sysfs() calls
class_device_unregister(), which will decrement the class_device's
reference count.  When it hits 0, ib_device_release() will be called
to actually free the structure.

(We only need the kfree in the uninitialized case, since that is when
the class_device has not been registered with the driver model)

 - Roland




More information about the general mailing list