linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Coverity: pre_compute_mst_dsc_configs_for_state(): Uninitialized variables
@ 2022-11-18 16:50 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2022-11-18 16:50 UTC (permalink / raw)
  To: Lyude Paul
  Cc: David Airlie, Fangzhi Zuo, Harry Wentland, Christian König,
	Wayne Lin, stable, #v5.6+,
	linux-kernel, Thomas Zimmermann, Daniel Vetter, Rodrigo Siqueira,
	Roman Li, amd-gfx, Daniel Wheeler, Leo Li, Alex Deucher, Pan,
	Xinhui, hersen wu, Nicholas Kazlauskas, dri-devel,
	Aurabindo Pillai, Hamza Mahfooz, Alex Hung, Gustavo A. R. Silva,
	linux-next, linux-hardening

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221118 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Thu Nov 17 00:18:25 2022 -0500
    7cce4cd628be ("drm/amdgpu/mst: Stop ignoring error codes and deadlocking")

Coverity reported the following:

*** CID 1527373:  Uninitialized variables  (UNINIT)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c:1227 in pre_compute_mst_dsc_configs_for_state()
1221     		for (j = 0; j < dc_state->stream_count; j++) {
1222     			if (dc_state->streams[j]->link == stream->link)
1223     				computed_streams[j] = true;
1224     		}
1225     	}
1226
vvv     CID 1527373:  Uninitialized variables  (UNINIT)
vvv     Using uninitialized value "ret".
1227     	return ret;
1228     }
1229
1230     static int find_crtc_index_in_state_by_stream(struct drm_atomic_state *state,
1231     					      struct dc_stream_state *stream)
1232     {

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527373 ("Uninitialized variables")
Fixes: 7cce4cd628be ("drm/amdgpu/mst: Stop ignoring error codes and deadlocking")

If dc_state->stream_count is 0, "ret" is undefined. Perhaps initialize
it as -EINVAL?

Thanks for your attention!

-- 
Coverity-bot

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-18 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18 16:50 Coverity: pre_compute_mst_dsc_configs_for_state(): Uninitialized variables coverity-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).