From: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
To: Claudiu Beznea <claudiu.beznea@microchip.com>,
<yannick.fertre@foss.st.com>, <philippe.cornu@foss.st.com>,
<airlied@gmail.com>, <daniel@ffwll.ch>,
<mcoquelin.stm32@gmail.com>, <alexandre.torgue@foss.st.com>
Cc: <dri-devel@lists.freedesktop.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/stm: ltdc: check memory returned by devm_kzalloc()
Date: Wed, 31 May 2023 14:23:03 +0200 [thread overview]
Message-ID: <421ecc95-413d-71c3-36e3-abc8da9db316@foss.st.com> (raw)
In-Reply-To: <20230531072854.142629-1-claudiu.beznea@microchip.com>
On 5/31/23 09:28, Claudiu Beznea wrote:
> devm_kzalloc() can fail and return NULL pointer. Check its return status.
> Identified with Coccinelle (kmerr.cocci script).
>
> Fixes: 484e72d3146b ("drm/stm: ltdc: add support of ycbcr pixel formats")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>
> Hi,
Hi Claudiu
>
> This has been addressed using kmerr.cocci script proposed for update
> at [1].
>
> Thank you,
> Claudiu Beznea
>
> [1] https://lore.kernel.org/all/20230530074044.1603426-1-claudiu.beznea@microchip.com/
>
> drivers/gpu/drm/stm/ltdc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 03c6becda795..9f3ac54d4cb3 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -1579,6 +1579,8 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
> ARRAY_SIZE(ltdc_drm_fmt_ycbcr_sp) +
> ARRAY_SIZE(ltdc_drm_fmt_ycbcr_fp)) *
> sizeof(*formats), GFP_KERNEL);
> + if (!formats)
> + return NULL;
>
> for (i = 0; i < ldev->caps.pix_fmt_nb; i++) {
> drm_fmt = ldev->caps.pix_fmt_drm[i];
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Thanks for your patch.
Cheers,
Raphaël G.-P.
next prev parent reply other threads:[~2023-05-31 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 7:28 Claudiu Beznea
2023-05-31 12:23 ` Raphael Gallais-Pou [this message]
2024-07-15 8:33 ` Raphael Gallais-Pou
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=421ecc95-413d-71c3-36e3-abc8da9db316@foss.st.com \
--to=raphael.gallais-pou@foss.st.com \
--cc=airlied@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=claudiu.beznea@microchip.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=philippe.cornu@foss.st.com \
--cc=yannick.fertre@foss.st.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®