]> git.baikalelectronics.ru Git - kernel.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)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Oct 2019 18:57:05 +0000 (20:57 +0200)
commitb6fbe91129c64cf7774fb8b90bb258d5f3984a4b
tree0c6dd9aa262e4c84b7d03b34ee89534f88216952
parent121f47a704fc10512bcfb819d82b91e1383cf25c
drm/v3d: Fix memory leak in v3d_submit_cl_ioctl

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: c7fba1594649 ("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
drivers/gpu/drm/v3d/v3d_gem.c