[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e055af1a-908c-2628-fd7b-531210163789@quicinc.com>
Date: Tue, 13 Dec 2022 13:37:13 -0800
From: Abhinav Kumar <quic_abhinavk@...cinc.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>, <robdclark@...il.com>,
<dmitry.baryshkov@...aro.org>, <sean@...rly.run>,
<airlied@...il.com>, <daniel@...ll.ch>,
<quic_jesszhan@...cinc.com>, <ville.syrjala@...ux.intel.com>,
<yang.lee@...ux.alibaba.com>
CC: <linux-arm-msm@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<freedreno@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/msm/dpu: Add check for pstates
On 12/6/2022 12:02 AM, Jiasheng Jiang wrote:
> As kzalloc may fail and return NULL pointer,
> it should be better to check pstates
> in order to avoid the NULL pointer dereference.
>
> Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
Once again, your lines are wrapped around too early, please use the full
character limit for the commit text.
With that fixed,
Reviewed-by: Abhinav Kumar <quic_abhinavk@...cinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 13ce321283ff..f51cb46ecfd6 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -1150,6 +1150,8 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc,
> bool needs_dirtyfb = dpu_crtc_needs_dirtyfb(crtc_state);
>
> pstates = kzalloc(sizeof(*pstates) * DPU_STAGE_MAX * 4, GFP_KERNEL);
> + if (!pstates)
> + return -ENOMEM;
>
> if (!crtc_state->enable || !crtc_state->active) {
> DRM_DEBUG_ATOMIC("crtc%d -> enable %d, active %d, skip atomic_check\n",
Powered by blists - more mailing lists