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
---
oc().
Signed-off-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
calling kzalloc().
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/d
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
heck
in the front 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_he
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