lkml.org 
[lkml]   [2020]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] RDMA/core: fix missing release in add_port.
Date
From: Qiushi Wu <wu000273@umn.edu>

In function add_port(), pointer p is not released in error paths.
Fix this issue by adding a kfree(p) into the end of error path.

Signed-off-by: Qiushi Wu <wu000273@umn.edu>
---
drivers/infiniband/core/sysfs.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 087682e6969e..04a003378dfc 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -1202,6 +1202,7 @@ static int add_port(struct ib_core_device *coredev, int port_num)

err_put:
kobject_put(&p->kobj);
+ kfree(p);
return ret;
}

--
2.17.1
\
 
 \ /
  Last update: 2020-05-25 08:08    [W:0.070 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site