mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
thunderbolt: Fix memory leak if ida_simple_get() fails in enumerate_services()
commita663e0df4aupstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
da9de75cde
commit
111fd1676e
|
|
@ -774,6 +774,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user