[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd901d8BTm--jrfyLkRSd0BTCvAuEy-DUs+SSzt+WBWzJw@mail.gmail.com>
Date: Sun, 7 Oct 2012 21:56:45 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: airlied@...ux.ie
Cc: yongjun_wei@...ndmicro.com.cn, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] gma500: medfield: fix potential NULL pointer dereference in mdfld_dsi_output_init()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
The dereference should be moved below the NULL test.
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
drivers/gpu/drm/gma500/mdfld_dsi_output.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.c b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
index 32dba2a..f92932f 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_output.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_output.c
@@ -500,17 +500,18 @@ void mdfld_dsi_output_init(struct drm_device *dev,
struct mdfld_dsi_connector *dsi_connector;
struct drm_connector *connector;
struct mdfld_dsi_encoder *encoder;
- struct drm_psb_private *dev_priv = dev->dev_private;
+ struct drm_psb_private *dev_priv;
struct panel_info dsi_panel_info;
u32 width_mm, height_mm;
- dev_dbg(dev->dev, "init DSI output on pipe %d\n", pipe);
-
if (!dev || ((pipe != 0) && (pipe != 2))) {
DRM_ERROR("Invalid parameter\n");
return;
}
+ dev_dbg(dev->dev, "init DSI output on pipe %d\n", pipe);
+ dev_priv = dev->dev_private;
+
/*create a new connetor*/
dsi_connector = kzalloc(sizeof(struct mdfld_dsi_connector), GFP_KERNEL);
if (!dsi_connector) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists