[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1800775a-5788-b60b-87cb-9b09c7e7c177@amd.com>
Date: Thu, 5 Jan 2023 14:19:50 -0500
From: Harry Wentland <harry.wentland@....com>
To: Yi Yang <yiyang13@...wei.com>, sunpeng.li@....com,
Rodrigo.Siqueira@....com, alexander.deucher@....com,
christian.koenig@....com, Xinhui.Pan@....com, airlied@...il.com,
daniel@...ll.ch
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] drm/amd/display: Remove redundant assignment to
variable dc
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@...wei.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@....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) {
Powered by blists - more mailing lists