[PATCH] drm/amd/display: remove an unnecessary NULL check
The 'pipe' can't be NULL because it points to an element of array. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixed: 7cf2c840c6b5 (drm/amd/display: Commit validation set from state) Signed-off-by: Danila Chernetsov --- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 0cb8d1f934d1..d3b850372eb3 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1854,7 +1854,7 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c for (k = 0; k < MAX_PIPES; k++) { pipe = >res_ctx.pipe_ctx[k]; - for (l = 0 ; pipe && l < context->stream_count; l++) { + for (l = 0 ; l < context->stream_count; l++) { if (context->streams[l] && context->streams[l] == pipe->stream && dc->hwss.setup_stereo) -- 2.25.1
Re: [PATCH] drm/amd/display: remove an unnecessary NULL check
On Tue, Jul 14, 2020 at 6:57 AM Dan Carpenter wrote: > > The "stream" pointer can't be NULL and it's dereferenced on the line > before so the check doesn't make sense. > > Signed-off-by: Dan Carpenter Applied. Thanks! Alex > --- > drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c > b/drivers/gpu/drm/amd/display/dc/core/dc.c > index 4f97329d9daf..7e58f242dab9 100644 > --- a/drivers/gpu/drm/amd/display/dc/core/dc.c > +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c > @@ -2324,7 +2324,7 @@ static void commit_planes_for_stream(struct dc *dc, > > if ((update_type != UPDATE_TYPE_FAST) && > stream->update_flags.bits.dsc_changed) > if > (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) { > - if (stream && should_use_dmub_lock(stream->link)) { > + if (should_use_dmub_lock(stream->link)) { > union dmub_hw_lock_flags hw_locks = { 0 }; > struct dmub_hw_lock_inst_flags inst_flags = { > 0 }; > > -- > 2.27.0 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amd/display: remove an unnecessary NULL check
The "stream" pointer can't be NULL and it's dereferenced on the line before so the check doesn't make sense. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 4f97329d9daf..7e58f242dab9 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -2324,7 +2324,7 @@ static void commit_planes_for_stream(struct dc *dc, if ((update_type != UPDATE_TYPE_FAST) && stream->update_flags.bits.dsc_changed) if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) { - if (stream && should_use_dmub_lock(stream->link)) { + if (should_use_dmub_lock(stream->link)) { union dmub_hw_lock_flags hw_locks = { 0 }; struct dmub_hw_lock_inst_flags inst_flags = { 0 }; -- 2.27.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx