mirror of https://gitee.com/openkylin/linux.git
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: be1da7070a
("drm/i915/gvt: vGPU command scanner")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
parent
850555d1d3
commit
ffdf16edfb
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue