Skip to content

Commit

Permalink
drm/fb-helper: Do the 'max_conn_count' zero check
Browse files Browse the repository at this point in the history
Since we cannot make sure the 'max_conn_count' will always be none
zero from the users, and then if max_conn_count equals to zero, the
kcalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16).

So this patch fix this with just doing the 'max_conn_count' zero check
in the front of drm_fb_helper_init().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
CC: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Xiubo Li authored and Daniel Vetter committed Mar 17, 2014
1 parent 409bbf1 commit 04cfe97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ int drm_fb_helper_init(struct drm_device *dev,
struct drm_crtc *crtc;
int i;

if (!max_conn_count)
return -EINVAL;

fb_helper->dev = dev;

INIT_LIST_HEAD(&fb_helper->kernel_fb_list);
Expand Down

0 comments on commit 04cfe97

Please sign in to comment.