summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorHefty, Sean <sean.hefty@intel.com>2008-09-30 19:36:54 +0200
committerRoland Dreier <rolandd@cisco.com>2008-09-30 19:36:54 +0200
commita7e80ce26caa174b1caa5fdfbb3dbd740a87d33a (patch)
tree5d5060f711aa2ec343086ced1a9257c29f4e3000 /drivers/infiniband
parentMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 (diff)
downloadlinux-a7e80ce26caa174b1caa5fdfbb3dbd740a87d33a.tar.xz
linux-a7e80ce26caa174b1caa5fdfbb3dbd740a87d33a.zip
IB/cm: Correctly free cm_device structure
commit 110cf374 ("infiniband: make cm_device use a struct device and not a kobject.") introduced a memory leak, since it deleted cm_release_dev_obj(), which was where cm_dev was freed. Fix this by freeing the leaked structure after calling device_unregister(). Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/cm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 922d35f4fc08..3cab0cedfca2 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3748,6 +3748,7 @@ error1:
cm_remove_port_fs(port);
}
device_unregister(cm_dev->device);
+ kfree(cm_dev);
}
static void cm_remove_one(struct ib_device *ib_device)
@@ -3776,6 +3777,7 @@ static void cm_remove_one(struct ib_device *ib_device)
cm_remove_port_fs(port);
}
device_unregister(cm_dev->device);
+ kfree(cm_dev);
}
static int __init ib_cm_init(void)