Commit 8ffa289f authored by Charlene Liu's avatar Charlene Liu Committed by Alex Deucher
Browse files

drm/amd/display: Add null pointer check in link_dpms



[why]
Check that the stream exists to add link->local_sink null pointer access
protection.

Reviewed-by: default avatarHarold Sun <harold.sun@amd.com>
Reviewed-by: default avatarEthan Cheung <ethan.cheung@amd.com>
Signed-off-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
Signed-off-by: default avatarIvan Lipski <ivan.lipski@amd.com>
Tested-by: default avatarDan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 79b3c037
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2226,7 +2226,11 @@ static enum dc_status enable_link(
{
	enum dc_status status = DC_ERROR_UNEXPECTED;
	struct dc_stream_state *stream = pipe_ctx->stream;
	struct dc_link *link = stream->link;
	struct dc_link *link = NULL;

	if (stream == NULL)
		return DC_ERROR_UNEXPECTED;
	link = stream->link;

	/* There's some scenarios where driver is unloaded with display
	 * still enabled. When driver is reloaded, it may cause a display