disp: msm: dp: Handle aux switch node missing in device tree
Ensure to allocate switch type as bypass in case of dp aux switch node missing in device tree entry and prevent any scope of null pointer dereferencing. Change-Id: I1d50d785e028f2e69a0effaedb2dbb6568a473dd Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
This commit is contained in:
@@ -2158,8 +2158,10 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
|
||||
|
||||
dp->aux_switch_node = of_parse_phandle(dp->pdev->dev.of_node, phandle, 0);
|
||||
if (!dp->aux_switch_node) {
|
||||
DP_DEBUG("cannot parse %s handle\n", phandle);
|
||||
dp->no_aux_switch = true;
|
||||
DP_WARN("Aux switch node not found, assigning bypass mode as switch type\n");
|
||||
dp->switch_type = DP_AUX_SWITCH_BYPASS;
|
||||
goto skip_node_name;
|
||||
}
|
||||
|
||||
if (!strcmp(dp->aux_switch_node->name, "fsa4480"))
|
||||
@@ -2169,6 +2171,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
|
||||
else
|
||||
dp->switch_type = DP_AUX_SWITCH_BYPASS;
|
||||
|
||||
skip_node_name:
|
||||
dp->aux = dp_aux_get(dev, &dp->catalog->aux, dp->parser,
|
||||
dp->aux_switch_node, dp->aux_bridge, dp->switch_type);
|
||||
if (IS_ERR(dp->aux)) {
|
||||
|
||||
Reference in New Issue
Block a user