]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:52:48 +0000 (14:52 +0100)
commitb6534b3e08e8e10e871b53ce5a1e9ce4bcb94907
treed3f8652bf711bb5dda734ee9770c6a121c4cf01c
parent2980235974cdb243b06d8eb9d12a3fce44f401a1
drm/i915/gvt: fix memory leak of a cmd_entry struct on error exit path

commit ffdf16edfbbe77f5f5c3c87fe8d7387ecd16241b upstream

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>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/gvt/cmd_parser.c