hdmitx: fix a null pointer in hdmitx_late_resume function
authorYi Zhou <yi.zhou@amlogic.com>
Tue, 20 Mar 2018 09:30:41 +0000 (17:30 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Wed, 21 Mar 2018 13:17:28 +0000 (05:17 -0800)
PD#162465: hdmitx: fix a null pointer in hdmitx_late_resume function

Change-Id: Ib4b3f55d2ca8274fb4c1000cf79f403006d7a475
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c

index ec37f99..f827ecc 100644 (file)
@@ -158,11 +158,17 @@ static void hdmitx_late_resume(struct early_suspend *h)
        /*open vpu clk*/
        if (phdmi->hdmitx_clk_tree.hdmi_clk_vapb != NULL)
                clk_prepare_enable(phdmi->hdmitx_clk_tree.hdmi_clk_vapb);
+
        if (phdmi->hdmitx_clk_tree.hdmi_clk_vpu != NULL)
                clk_prepare_enable(phdmi->hdmitx_clk_tree.hdmi_clk_vpu);
 
-       if (info && (strncmp(info->name, "panel", 5) == 0 ||
-               strncmp(info->name, "null", 4) == 0)) {
+       if ((info == NULL) || (info->name == NULL)) {
+               pr_info(SYS "vinfo is NULL\n");
+               return;
+       }
+
+       if (strncmp(info->name, "panel", 5) == 0 ||
+               strncmp(info->name, "null", 4) == 0) {
                ;
        } else {
                if (hdmitx_is_hdmi_vmode(info->name) == 1)