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

Krishna Kumar krkumar at us.ibm.com
Thu Sep 2 14:40:57 PDT 2004


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

Rest looks fine to my sysfs-untrained eyes :-)

- KK

+void ib_dealloc_device(struct ib_device *device)
+{
+       if (device->reg_state == IB_DEV_UNINITIALIZED)
+               goto out;
+
+       printk(KERN_ERR "device->reg_state = %d\n", device->reg_state);
+       BUG_ON(device->reg_state != IB_DEV_UNREGISTERED);
+
+       ib_device_deregister_sysfs(device);
+
+out:
+	kfree(device);
+}




More information about the general mailing list