Commit a663e0df authored by Mika Westerberg's avatar Mika Westerberg

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: 9aabb685 ("thunderbolt: Fix to check return value of ida_simple_get")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent 7342ca34
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment