diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-01-28 08:41:39 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-28 08:41:39 -0800 |
| commit | 75dd5607f1b5c9ce1ca56d8ff56872e1794d9d71 (patch) | |
| tree | 60688a63e6a7c941c77f586b3d535d48d8b11eca | |
| parent | 6bc4fad307f91c0872914fd810cb16fa061a7842 (diff) | |
| parent | b48dd8e3f6c73f53a0d7ef3cb70f23b8455c4887 (diff) | |
Merge "msm: mdss: fix potential null pointer dereference in HDMI driver"
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_edid.c | 5 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_hdmi_tx.c | 21 |
2 files changed, 18 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_edid.c b/drivers/video/fbdev/msm/mdss_hdmi_edid.c index 36209e36b324..3d8fe2ceebac 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_edid.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_edid.c @@ -2478,6 +2478,11 @@ bool hdmi_edid_is_s3d_mode_supported(void *input, u32 video_mode, u32 s3d_mode) struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input; struct hdmi_edid_sink_data *sink_data; + if (!edid_ctrl) { + DEV_ERR("%s: invalid input\n", __func__); + return false; + } + sink_data = &edid_ctrl->sink_data; for (i = 0; i < sink_data->num_of_elements; ++i) { if (sink_data->disp_mode_list[i].video_format != video_mode) diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c index d573bd1eb0ba..04c7ec326a47 100644 --- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c +++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c @@ -1610,14 +1610,18 @@ static void hdmi_tx_hdcp_cb_work(struct work_struct *work) } if (hdmi_tx_is_panel_on(hdmi_ctrl)) { - DEV_DBG("%s: Reauthenticating\n", __func__); - rc = hdmi_ctrl->hdcp_ops->reauthenticate( - hdmi_ctrl->hdcp_data); - if (rc) - DEV_ERR("%s: HDCP reauth failed. rc=%d\n", - __func__, rc); + pr_debug("%s: Reauthenticating\n", __func__); + if (hdmi_ctrl->hdcp_ops && hdmi_ctrl->hdcp_data) { + rc = hdmi_ctrl->hdcp_ops->reauthenticate( + hdmi_ctrl->hdcp_data); + if (rc) + pr_err("%s: HDCP reauth failed. rc=%d\n", + __func__, rc); + } else + pr_err("%s: NULL HDCP Ops and Data\n", + __func__); } else { - DEV_DBG("%s: Not reauthenticating. Cable not conn\n", + pr_debug("%s: Not reauthenticating. Cable not conn\n", __func__); } @@ -2284,7 +2288,8 @@ static void hdmi_tx_update_hdcp_info(struct hdmi_tx_ctrl *hdmi_ctrl) if (hdmi_ctrl->hdcp14_present) { fd = hdmi_tx_get_fd(HDMI_TX_FEAT_HDCP); - ops = hdcp_1x_start(fd); + if (fd) + ops = hdcp_1x_start(fd); } } |
