From 0f4f0fb0fdc45851469407e245f8a5ce4824f7f1 Mon Sep 17 00:00:00 2001 From: Satya Rama Aditya Pinapala Date: Tue, 25 Feb 2020 19:46:31 -0800 Subject: [PATCH] disp: msm: dsi: fix kw issues in DSI Change initializes uninitialized variables and handles null pointer references in DSI driver. Change-Id: I24200b4bafc5e0b223d64b1ad66fdebeeea37e99 Signed-off-by: Satya Rama Aditya Pinapala --- msm/dsi/dsi_ctrl_hw_cmn.c | 8 ++++---- msm/dsi/dsi_pll.c | 10 ++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/msm/dsi/dsi_ctrl_hw_cmn.c b/msm/dsi/dsi_ctrl_hw_cmn.c index 793a14d127..1cfc48f161 100644 --- a/msm/dsi/dsi_ctrl_hw_cmn.c +++ b/msm/dsi/dsi_ctrl_hw_cmn.c @@ -399,13 +399,13 @@ void dsi_ctrl_hw_cmn_setup_cmd_stream(struct dsi_ctrl_hw *ctrl, u32 vc_id, struct dsi_rect *roi) { - u32 width_final, stride_final; - u32 height_final; + u32 width_final = 0, stride_final = 0; + u32 height_final = 0; u32 stream_total = 0, stream_ctrl = 0; u32 reg_ctrl = 0, reg_ctrl2 = 0, data = 0; u32 reg = 0, offset = 0; - int pic_width, this_frame_slices, intf_ip_w; - u32 pkt_per_line, eol_byte_num, bytes_in_slice; + int pic_width = 0, this_frame_slices = 0, intf_ip_w = 0; + u32 pkt_per_line = 0, eol_byte_num = 0, bytes_in_slice = 0; if (roi && (!roi->w || !roi->h)) return; diff --git a/msm/dsi/dsi_pll.c b/msm/dsi/dsi_pll.c index c323bd050f..fa6a08db25 100644 --- a/msm/dsi/dsi_pll.c +++ b/msm/dsi/dsi_pll.c @@ -70,10 +70,12 @@ int dsi_pll_init(struct platform_device *pdev, struct dsi_pll_resource **pll) *pll = pll_res; label = of_get_property(pdev->dev.of_node, "pll-label", NULL); - if (!label) - DSI_PLL_INFO(pll_res, "DSI pll label not specified\n"); - else - DSI_PLL_INFO(pll_res, "DSI pll label = %s\n", label); + if (!label) { + DSI_PLL_ERR(pll_res, "DSI pll label not specified\n"); + return 0; + } + + DSI_PLL_INFO(pll_res, "DSI pll label = %s\n", label); /** * Currently, Only supports 5nm PLL version. Will add