]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/v3d: Fix memory leak in v3d_submit_cl_ioctl
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Mon, 21 Oct 2019 18:52:49 +0000 (13:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:27:49 +0000 (19:27 +0100)
commit43ed09d84c7def99b38075b4f553d543b68afcd7
tree16b777d5b83d4574cded88348a1ae54dc47d7a47
parent4df6b9f49d3c6e9c6b658f4f01b896bce7698bca
drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

[ Upstream commit 29cd13cfd7624726d9e6becbae9aa419ef35af7f ]

In the impelementation of v3d_submit_cl_ioctl() there are two memory
leaks. One is when allocation for bin fails, and the other is when bin
initialization fails. If kcalloc fails to allocate memory for bin then
render->base should be put. Also, if v3d_job_init() fails to initialize
bin->base then allocated memory for bin should be released.

Fixes: a783a09ee76d ("drm/v3d: Refactor job management.")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191021185250.26130-1-navid.emamdoost@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/v3d/v3d_gem.c