]> git.baikalelectronics.ru Git - kernel.git/commit
drm/fb_helper: Fix potential NULL pointer dereference
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 19 Nov 2012 09:44:58 +0000 (09:44 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 20 Nov 2012 05:40:56 +0000 (15:40 +1000)
commit81eb28353ee5467c8b194a1d7837086a2c030071
tree0cb9fff757da368a457aba0580e9027048868313
parentafcdc70a2beb8d85bfb4fed11329cdd26a9fdea8
drm/fb_helper: Fix potential NULL pointer dereference

kcalloc returns NULL on failure. Hence check for the return value
and exit on error to avoid NULL pointer dereference.

Fixes the following smatch errors:
drivers/gpu/drm/drm_fb_helper.c:1271 drm_setup_crtcs() error:
potential null dereference 'modes'.  (kcalloc returns null)
drivers/gpu/drm/drm_fb_helper.c:1272 drm_setup_crtcs() error:
potential null dereference 'crtcs'.  (kcalloc returns null)

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fb_helper.c