[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 11 Nov 2016 17:13:29 +0530
From: Shailendra Verma <shailendra.v@...sung.com>
To: Liviu Dudau <liviu.dudau@....com>,
Brian Starkey <brian.starkey@....com>,
Mali DP Maintainers <malidp@...s.arm.com>,
David Airlie <airlied@...ux.ie>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Shailendra Verma <shailendra.v@...sung.com>,
Shailendra Verma <shailendra.capricorn@...il.com>
Cc: vidushi.koul@...sung.com
Subject: [PATCH] Gpu: drm: arm: - Fix possible dereference of NULL
From: "Shailendra Verma" <shailendra.v@...sung.com>
There is possible dereference of NULL pointer if kmalloc fails,
When function returns.So return NULL if kmalloc fails.
Signed-off-by: Shailendra Verma <Shailendra.v@...sung.com>
---
drivers/gpu/drm/arm/malidp_planes.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 82c193e..f769398 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -54,6 +54,9 @@ struct drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
return NULL;
state = kmalloc(sizeof(*state), GFP_KERNEL);
+ if (!state)
+ return NULL;
+
if (state) {
m_state = to_malidp_plane_state(plane->state);
__drm_atomic_helper_plane_duplicate_state(plane, &state->base);
--
1.7.9.5
Powered by blists - more mailing lists