[ofa-general] [PATCH 2.6.27] ib/cm: free cm_device structure

Hefty, Sean sean.hefty at intel.com
Mon Aug 25 12:13:15 PDT 2008


commit 110cf374a809817d5c080c0ac82d65d029820a66 introduced a
memory leak.  Free the leaked structure.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---

 drivers/infiniband/core/cm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 922d35f..3cab0ce 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)





More information about the general mailing list