[PATCH 3/3] drm/global: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-08-12 Thread Xiubo Li
Since we cannot make sure the 'ref->size' will always be none zero here, and then if it equals to zero, the kzalloc() will return ZERO_SIZE_PTR, which equals to ((void *)16). This patch fix this with just doing the zero check before calling kzalloc(). Signed-off-by: Xiubo Li --- drivers/

[PATCH 2/3] drm/crtc: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-08-12 Thread Xiubo Li
-by: Xiubo Li --- drivers/gpu/drm/drm_crtc.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 901b812..2379c7a 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1507,9 +1507,14

[PATCH 1/3] drm/bufs: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-08-12 Thread Xiubo Li
Signed-off-by: Xiubo Li --- drivers/gpu/drm/drm_bufs.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 68175b5..09c1e8c 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c @@ -617,6

[PATCH 0/3] drm: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

2014-08-12 Thread Xiubo Li
Xiubo Li (3): drm/bufs: Fix possible ZERO_SIZE_PTR pointer dereferencing error. drm/crtc: Fix possible ZERO_SIZE_PTR pointer dereferencing error. drm/global: Fix possible ZERO_SIZE_PTR pointer dereferencing error. drivers/gpu/drm/drm_bufs.c | 12 +--- drivers/gpu/drm/drm_crtc.c

[PATCH v2] drm/fb-helper: Do the 'max_conn_count' zero check

2014-03-10 Thread Xiubo Li
of drm_fb_helper_init(). Signed-off-by: Xiubo Li CC: Jani Nikula --- drivers/gpu/drm/drm_fb_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 3d13ca6e2..a0d286c 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers

[PATCH] drm/fb-helper: Do the mode_set.connectors ZERO_SIZE_PTR check

2014-03-06 Thread Xiubo Li
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 via doing the zero pionter check of it. Signed-off-by: Xiubo Li