public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: coverity-bot <keescook@chromium.org>
To: Lyude Paul <lyude@redhat.com>
Cc: "David Airlie" <airlied@gmail.com>,
	"Fangzhi Zuo" <Jerry.Zuo@amd.com>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Wayne Lin" <Wayne.Lin@amd.com>,
	stable@vger.kernel.org, #v5.6+@kernel,
	linux-kernel@vger.kernel.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Roman Li" <roman.li@amd.com>,
	amd-gfx@lists.freedesktop.org,
	"Daniel Wheeler" <daniel.wheeler@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"hersen wu" <hersenxs.wu@amd.com>,
	"Nicholas Kazlauskas" <nicholas.kazlauskas@amd.com>,
	dri-devel@lists.freedesktop.org,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Hamza Mahfooz" <hamza.mahfooz@amd.com>,
	"Alex Hung" <alex.hung@amd.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	linux-next@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Coverity: pre_compute_mst_dsc_configs_for_state(): Uninitialized variables
Date: Fri, 18 Nov 2022 08:50:35 -0800	[thread overview]
Message-ID: <202211180850.560AD5A74@keescook> (raw)

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

                 reply	other threads:[~2022-11-18 16:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211180850.560AD5A74@keescook \
    --to=keescook@chromium.org \
    --cc=#v5.6+@kernel \
    --cc=Jerry.Zuo@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Wayne.Lin@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@embeddedor.com \
    --cc=hamza.mahfooz@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=hersenxs.wu@amd.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=nicholas.kazlauskas@amd.com \
    --cc=roman.li@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=sunpeng.li@amd.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox