lkml.org 
[lkml]   [2018]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-4.16-rc5/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c:1723]: (warning) Possible null pointer dereference: pipe_ctx
From
Date


On 03/12/2018 06:22 AM, David Binderman wrote:
> hello there,
>
> Source code is
>
>
>     for (i = 0; i < dc->res_pool->pipe_count; i++) {
>         if (res_ctx->pipe_ctx[i].stream) {
>             pipe_ctx = &res_ctx->pipe_ctx[i];
>             *pipe_idx = i;
>             break;
>         }
>     }

Indeed something like

if (!pipe_ctx)
              return false;

seems the right thing here.

Harry, Roman , your opinion ?

Andrey

>
>     /* Only supports eDP */
>     if (pipe_ctx->stream->sink->link->connector_signal != SIGNAL_TYPE_EDP)
>         return false;
>
> Suggest add some code to deal with the case that the for loop doesn't find
> what it is looking for and so pipe_ctx is NULL.
>
> Regards
>
> David Binderman
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

\
 
 \ /
  Last update: 2018-03-12 23:24    [W:0.261 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site