From: Harry Wentland <harry.wentland@amd.com>
To: Yi Yang <yiyang13@huawei.com>,
sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com,
alexander.deucher@amd.com, christian.koenig@amd.com,
Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] drm/amd/display: Remove redundant assignment to variable dc
Date: Thu, 5 Jan 2023 14:19:50 -0500 [thread overview]
Message-ID: <1800775a-5788-b60b-87cb-9b09c7e7c177@amd.com> (raw)
In-Reply-To: <20221216102318.197994-1-yiyang13@huawei.com>
On 12/16/22 05:23, Yi Yang wrote:
> Smatch report warning as follows:
>
> Line 53679: drivers/gpu/drm/amd/display/dc/core/dc_stream.c:402
> dc_stream_set_cursor_position() warn: variable dereferenced before
> check 'stream'
>
> The value of 'dc' has been assigned after check whether 'stream' is
> NULL. Fix it by remove redundant assignment.
>
> Signed-off-by: Yi Yang <yiyang13@huawei.com>
If this didn't blow up until now we might not even need
the NULL check below, but either way this is correct and
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index 20e534f73513..78d31bb875d1 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -408,7 +408,7 @@ bool dc_stream_set_cursor_position(
> struct dc_stream_state *stream,
> const struct dc_cursor_position *position)
> {
> - struct dc *dc = stream->ctx->dc;
> + struct dc *dc;
> bool reset_idle_optimizations = false;
>
> if (NULL == stream) {
next prev parent reply other threads:[~2023-01-05 19:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 10:23 Yi Yang
2023-01-05 19:19 ` Harry Wentland [this message]
2023-01-06 15:28 ` Alex Deucher
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=1800775a-5788-b60b-87cb-9b09c7e7c177@amd.com \
--to=harry.wentland@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=yiyang13@huawei.com \
/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
all inboxes | Powered by JetHome®