diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-10-07 17:06:17 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2020-11-05 13:32:40 +0300 |
commit | a663e0df4a374b8537562a44d1cecafb472cd65b (patch) | |
tree | 5f94ba9fa3752015956340416722f5161c4ef414 /drivers/thunderbolt/xdomain.c | |
parent | 7342ca34d931a357d408aaa25fadd031e46af137 (diff) |
thunderbolt: Fix memory leak if ida_simple_get() fails in enumerate_services()
The svc->key field is not released as it should be if ida_simple_get()
fails so fix that.
Fixes: 9aabb68568b4 ("thunderbolt: Fix to check return value of ida_simple_get")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/xdomain.c')
-rw-r--r-- | drivers/thunderbolt/xdomain.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c index 48907853732a..c00ad817042e 100644 --- a/drivers/thunderbolt/xdomain.c +++ b/drivers/thunderbolt/xdomain.c @@ -881,6 +881,7 @@ static void enumerate_services(struct tb_xdomain *xd) id = ida_simple_get(&xd->service_ids, 0, 0, GFP_KERNEL); if (id < 0) { + kfree(svc->key); kfree(svc); break; } |