From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>, <robdclark@gmail.com>,
<dmitry.baryshkov@linaro.org>, <sean@poorly.run>,
<airlied@gmail.com>, <daniel@ffwll.ch>,
<quic_jesszhan@quicinc.com>, <ville.syrjala@linux.intel.com>,
<yang.lee@linux.alibaba.com>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/msm/dpu: Add check for cstate
Date: Tue, 6 Dec 2022 08:32:14 -0800 [thread overview]
Message-ID: <339d9ec4-a554-d468-51f4-498d785685b6@quicinc.com> (raw)
In-Reply-To: <20221206080517.43786-1-jiasheng@iscas.ac.cn>
On 12/6/2022 12:05 AM, Jiasheng Jiang wrote:
> As kzalloc may fail and return NULL pointer,
> it should be better to check cstate
> in order to avoid the NULL pointer dereference
> in __drm_atomic_helper_crtc_reset.
You have wrapped around your lines too short. Please try to utilize the
full word limit for each line.
With that fixed,
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>
> Fixes: 1cff7440a86e ("drm/msm: Convert to using __drm_atomic_helper_crtc_reset() for reset.")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> index 13ce321283ff..22c2787b7b38 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
> @@ -968,7 +968,10 @@ static void dpu_crtc_reset(struct drm_crtc *crtc)
> if (crtc->state)
> dpu_crtc_destroy_state(crtc, crtc->state);
>
> - __drm_atomic_helper_crtc_reset(crtc, &cstate->base);
> + if (cstate)
> + __drm_atomic_helper_crtc_reset(crtc, &cstate->base);
> + else
> + __drm_atomic_helper_crtc_reset(crtc, NULL);
> }
>
> /**
next prev parent reply other threads:[~2022-12-06 16:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 8:05 Jiasheng Jiang
2022-12-06 16:32 ` Abhinav Kumar [this message]
2023-01-08 21:56 ` Dmitry Baryshkov
2023-01-08 22:08 ` Dmitry Baryshkov
2023-01-26 19:01 ` Dmitry Baryshkov
-- strict thread matches above, loose matches on Subject: below --
2022-12-06 8:02 Jiasheng Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=339d9ec4-a554-d468-51f4-498d785685b6@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jiasheng@iscas.ac.cn \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_jesszhan@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=ville.syrjala@linux.intel.com \
--cc=yang.lee@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®