Skip to content

Commit

Permalink
drm/i915/hdcp: Fix uninitialized symbol
Browse files Browse the repository at this point in the history
Move (num_hdcp_streams > 0) condition to stream_encryption()
code block, where it actually belongs.
This fixes the static analysis error of uninitialized symbol 'ret'.

v2:
- return 0 as the return value is already checked. [Ankit]

Cc: Ramalingam C <[email protected]>
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Ankit Nautiyal <[email protected]>
Signed-off-by: Anshuman Gupta <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
anshuma1 committed Jan 22, 2021
1 parent 7fde594 commit 40a6cea
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/gpu/drm/i915/display/intel_hdcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,15 +878,15 @@ static int _intel_hdcp_disable(struct intel_connector *connector)
}
drm_dbg_kms(&dev_priv->drm, "HDCP 1.4 transcoder: %s stream encryption disabled\n",
transcoder_name(hdcp->stream_transcoder));
/*
* If there are other connectors on this port using HDCP,
* don't disable it until it disabled HDCP encryption for
* all connectors in MST topology.
*/
if (dig_port->num_hdcp_streams > 0)
return 0;
}

/*
* If there are other connectors on this port using HDCP, don't disable it
* until it disabled HDCP encryption for all connectors in MST topology.
*/
if (dig_port->num_hdcp_streams > 0)
return ret;

hdcp->hdcp_encrypted = false;
intel_de_write(dev_priv, HDCP_CONF(dev_priv, cpu_transcoder, port), 0);
if (intel_de_wait_for_clear(dev_priv,
Expand Down Expand Up @@ -1947,10 +1947,10 @@ static int _intel_hdcp2_disable(struct intel_connector *connector)
}
drm_dbg_kms(&i915->drm, "HDCP 2.2 transcoder: %s stream encryption disabled\n",
transcoder_name(hdcp->stream_transcoder));
}

if (dig_port->num_hdcp_streams > 0)
return ret;
if (dig_port->num_hdcp_streams > 0)
return 0;
}

ret = hdcp2_disable_encryption(connector);

Expand Down

0 comments on commit 40a6cea

Please sign in to comment.