]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commit
drm/i915/gvt: fix memory leak of a cmd_entry struct on error exit path
authorColin Ian King <colin.king@canonical.com>
Tue, 10 Apr 2018 12:33:12 +0000 (13:33 +0100)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 11 Apr 2018 06:37:58 +0000 (14:37 +0800)
commitffdf16edfbbe77f5f5c3c87fe8d7387ecd16241b
tree7cf253e987475cda7ff01fd566c751ef1bf9cd8e
parent850555d1d31e45fc3e9a2982f81717387e8d5e1b
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: be1da7070aea ("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>
drivers/gpu/drm/i915/gvt/cmd_parser.c