msm: mdss: fix NULL pointer dereferencing in DBA driver

In DBA driver, after complete raw EDID data is parsed,
the start address to audio block in EDID and its size is
stored in corresponding bridge chip local variable, using
a API implemented by the bridge chip driver. If the
bridge chip driver does not implement the API to set audio
block, then it will lead to crash if DBA driver tries to
use the API. So fix the issue by checking for NULL pointer
before calling the concerned API.

Change-Id: Ia65e7a6dccadbd3fa4a8a8e779ff1f08bf34b5af
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
This commit is contained in:
Sandeep Panda 2016-04-28 09:38:58 +05:30 committed by Harsh Sahu
parent 8f0b8a126c
commit d0a0f24144

View file

@ -323,7 +323,9 @@ static void mdss_dba_utils_dba_cb(void *data, enum msm_dba_callback_event event)
if (!ret) {
hdmi_edid_parser(udata->edid_data);
hdmi_edid_get_audio_blk(udata->edid_data, &blk);
udata->ops.set_audio_block(udata->dba_data,
if (udata->ops.set_audio_block)
udata->ops.set_audio_block(
udata->dba_data,
sizeof(blk), &blk);
} else {
pr_err("failed to get edid%d\n", ret);