[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <579998fc-12ee-fb23-afe5-f0ef70807a3c@denx.de>
Date: Wed, 3 Nov 2021 08:58:16 +0100
From: Marek Vasut <marex@...x.de>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>, stefan@...er.ch,
airlied@...ux.ie, daniel@...ll.ch, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com
Cc: dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm: mxsfb: Check NULL pointer
On 11/3/21 8:48 AM, Jiasheng Jiang wrote:
> As we see in the drm_connector_list_iter_next(), it could return
> NULL. In order to avoid the use of the NULL pointer, it may be
> better to check the return value.
>
> Fixes: c42001e ("drm: mxsfb: Use drm_panel_bridge")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 6da9355..b875c11 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -145,6 +145,8 @@ static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
> */
> drm_connector_list_iter_begin(drm, &iter);
> mxsfb->connector = drm_connector_list_iter_next(&iter);
> + if (!mxsfb->connector)
> + return 1;
In which case does this happen failure happen ?
What is the test case ?
Powered by blists - more mailing lists