Patch "drm/stm: ltdc: check memory returned by devm_kzalloc()" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-stm-ltdc-check-memory-returned-by-devm_kzalloc.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 742a0d40a9243627e518c38c5f9fb6d607d3a4dc
Author: Claudiu Beznea <claudiu.beznea@xxxxxxxxx>
Date:   Wed May 31 10:28:54 2023 +0300

    drm/stm: ltdc: check memory returned by devm_kzalloc()
    
    [ Upstream commit fd39730c58890cd7f0a594231e19bb357f28877c ]
    
    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@xxxxxxxxxxxxx>
    Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@xxxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230531072854.142629-1-claudiu.beznea@xxxxxxxxxxxxx
    Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 5576fdae49623..5aec1e58c968c 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -1580,6 +1580,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];




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux