* [bug report] drm/amd/display: Remove sink usage from DPMS
@ 2026-09-15 16:38 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-09-15 16:38 UTC (permalink / raw)
To: Dominik Kaszewski; +Cc: amd-gfx, SHANMUGAM, SRINIVASAN
Hello Dominik Kaszewski,
Commit 8fa813b7fd1e ("drm/amd/display: Remove sink usage from DPMS")
from Jun 19, 2026 (linux-next), leads to the following Smatch static
checker warning:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:2423 link_set_dpms_off()
error: we previously assumed 'stream->sink' could be null (see line 2412)
drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c
2386 enum dc_status link_set_dpms_off(struct pipe_ctx *pipe_ctx)
2387 {
2388 DC_LOGGER_INIT(pipe_ctx->stream->ctx->logger);
2389 struct dc_stream_state *stream = pipe_ctx->stream;
2390 struct dc *dc = stream->ctx->dc;
2391 struct dc_link *link = stream->link;
2392 struct vpg *vpg = get_vpg(pipe_ctx);
2393 enum dp_panel_mode panel_mode_dp = dp_get_panel_mode(link);
2394
2395 ASSERT(is_master_pipe_for_link(link, pipe_ctx));
2396
2397 if (dc_is_virtual_signal(stream->signal))
2398 /* No real hardware to program for virtual signals. */
2399 return DC_DPMS_SKIPPED_HANDSHAKE;
2400
2401 if (stream->sink) {
^^^^^^^^^^^^
2402 if (stream->sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
2403 stream->sink->sink_signal != SIGNAL_TYPE_NONE) {
2404 DC_LOG_DC("%s pipe_ctx dispname=%s signal=%x link=%d sink_count=%d\n", __func__,
2405 stream->sink->edid_caps.display_name,
2406 stream->signal, link->link_index, link->sink_count);
2407 }
2408 }
2409
2410 link_wait_for_unlocked(link);
2411
2412 if (stream->sink && !stream->sink->edid_caps.panel_patch.skip_avmute) {
^^^^^^^^^^^^
These places check for NULL
2413 if (dc_is_hdmi_signal(stream->signal))
2414 set_avmute(pipe_ctx, true);
2415 }
2416
2417 dc->hwss.disable_audio_stream(pipe_ctx);
2418
2419 update_psp_stream_config(pipe_ctx, true);
2420 dc->hwss.blank_stream(pipe_ctx);
2421
2422 if (pipe_ctx->link_config.dp_tunnel_settings.should_use_dp_bw_allocation)
--> 2423 deallocate_usb4_bandwidth(stream);
^^^^^^
But here stream->sink is dereferenced without checking.
2424
2425 if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
2426 deallocate_mst_payload(pipe_ctx);
2427 else if (dc_is_dp_sst_signal(stream->signal) &&
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-15 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 16:38 [bug report] drm/amd/display: Remove sink usage from DPMS Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.