RDMA/cxgb3: iwch_unregister_device leaks memory
authorSteve Wise <swise@opengridcomputing.com>
Sun, 6 Sep 2009 03:22:36 +0000 (20:22 -0700)
committerRoland Dreier <rolandd@cisco.com>
Sun, 6 Sep 2009 03:22:36 +0000 (20:22 -0700)
The iwcm struct mem is never freed.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/cxgb3/iwch_provider.c

index e2a63214008a90b1ddf137341bbbbc4eac2d16e4..72aa57cdf6979e1eeffd01bac06a8f41e22085ba 100644 (file)
@@ -1418,6 +1418,7 @@ int iwch_register_device(struct iwch_dev *dev)
 bail2:
        ib_unregister_device(&dev->ibdev);
 bail1:
+       kfree(dev->ibdev.iwcm);
        return ret;
 }
 
@@ -1430,5 +1431,6 @@ void iwch_unregister_device(struct iwch_dev *dev)
                device_remove_file(&dev->ibdev.dev,
                                   iwch_class_attributes[i]);
        ib_unregister_device(&dev->ibdev);
+       kfree(dev->ibdev.iwcm);
        return;
 }