Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/stm: ltdc: check memory returned by devm_kzalloc()

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>
Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230531072854.142629-1-claudiu.beznea@microchip.com
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>

authored by

Claudiu Beznea and committed by
Raphael Gallais-Pou
fd39730c 3ac93840

+2
+2
drivers/gpu/drm/stm/ltdc.c
··· 1580 1580 ARRAY_SIZE(ltdc_drm_fmt_ycbcr_sp) + 1581 1581 ARRAY_SIZE(ltdc_drm_fmt_ycbcr_fp)) * 1582 1582 sizeof(*formats), GFP_KERNEL); 1583 + if (!formats) 1584 + return NULL; 1583 1585 1584 1586 for (i = 0; i < ldev->caps.pix_fmt_nb; i++) { 1585 1587 drm_fmt = ldev->caps.pix_fmt_drm[i];