Commit ffdf16ed authored by Colin Ian King's avatar Colin Ian King Committed by Zhenyu Wang

drm/i915/gvt: fix memory leak of a cmd_entry struct on error exit path

The error exit path when a duplicate is found does not kfree and cmd_entry
struct and hence there is a small memory leak.  Fix this by kfree'ing it.

Detected by CoverityScan, CID#1370198 ("Resource Leak")

Fixes: be1da707 ("drm/i915/gvt: vGPU command scanner")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 850555d1
......@@ -2863,6 +2863,7 @@ static int init_cmd_table(struct intel_gvt *gvt)
if (info) {
gvt_err("%s %s duplicated\n", e->info->name,
info->name);
kfree(e);
return -EEXIST;
}
......
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