]> git.baikalelectronics.ru Git - kernel.git/commit
drm: fb: cma: fix memory leak
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Sun, 12 Jun 2016 15:03:56 +0000 (16:03 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 13 Jun 2016 07:53:09 +0000 (09:53 +0200)
commit4cea153d3487f8300979aad7870af719ee820350
tree997e1577d9e8d31dec38c1f57dd56a96bd5e567d
parent38cf8e8f0794ad3d1d335e122d64c4e3d0bd7546
drm: fb: cma: fix memory leak

We may have a situation that the memory allocation for fbdefio fails
and then the allocation for fbops may succeed as some memory has been
freed somewhere. Lets free fbops also to face these rare situtation.
Since kfree can handle arguments as NULL, there should not be any
problem in calling both the kfree().

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Fixes: cc269dca82c6 ("drm/fb-cma-helper: Add fb_deferred_io support")
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1465743836-6228-1-git-send-email-sudipm.mukherjee@gmail.com
drivers/gpu/drm/drm_fb_cma_helper.c