lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <421ecc95-413d-71c3-36e3-abc8da9db316@foss.st.com>
Date:   Wed, 31 May 2023 14:23:03 +0200
From:   Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>
To:     Claudiu Beznea <claudiu.beznea@...rochip.com>,
        <yannick.fertre@...s.st.com>, <philippe.cornu@...s.st.com>,
        <airlied@...il.com>, <daniel@...ll.ch>,
        <mcoquelin.stm32@...il.com>, <alexandre.torgue@...s.st.com>
CC:     <dri-devel@...ts.freedesktop.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/stm: ltdc: check memory returned by devm_kzalloc()


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@...rochip.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@...s.st.com>

Thanks for your patch.

Cheers,
Raphaƫl G.-P.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ