mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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: 9aabb68568 ("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>
This commit is contained in:
@@ -881,6 +881,7 @@ static void enumerate_services(struct tb_xdomain *xd)
|
|||||||
|
|
||||||
id = ida_simple_get(&xd->service_ids, 0, 0, GFP_KERNEL);
|
id = ida_simple_get(&xd->service_ids, 0, 0, GFP_KERNEL);
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
|
kfree(svc->key);
|
||||||
kfree(svc);
|
kfree(svc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user