Patch "media: drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers" has been added to the 6.1-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

    media: drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers

to the 6.1-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:
     media-drivers-media-v4l2-core-v4l2-h264-add-detectio.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 4ddc4f7dbb95a0e451fdcfb0d27753ac441cfa26
Author: Dong Chuanjian <chuanjian@xxxxxxxxxxxx>
Date:   Tue Dec 27 03:36:25 2022 +0100

    media: drivers/media/v4l2-core/v4l2-h264 : add detection of null pointers
    
    [ Upstream commit be3ae7cf4326e95bb1d5413b63baabc26f4a1324 ]
    
    When the pointer variable is judged to be null, null is returned
    directly.
    
    [hverkuil: fix two checkpatch warnings]
    
    Signed-off-by: Dong Chuanjian <chuanjian@xxxxxxxxxxxx>
    Acked-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
    Fixes: d3f756ad629b ("media: v4l2: Trace calculated p/b0/b1 initial reflist")
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/v4l2-core/v4l2-h264.c b/drivers/media/v4l2-core/v4l2-h264.c
index 72bd64f651981..c00197d095e75 100644
--- a/drivers/media/v4l2-core/v4l2-h264.c
+++ b/drivers/media/v4l2-core/v4l2-h264.c
@@ -305,6 +305,8 @@ static const char *format_ref_list_p(const struct v4l2_h264_reflist_builder *bui
 	int n = 0, i;
 
 	*out_str = kmalloc(tmp_str_size, GFP_KERNEL);
+	if (!(*out_str))
+		return NULL;
 
 	n += snprintf(*out_str + n, tmp_str_size - n, "|");
 
@@ -343,6 +345,8 @@ static const char *format_ref_list_b(const struct v4l2_h264_reflist_builder *bui
 	int n = 0, i;
 
 	*out_str = kmalloc(tmp_str_size, GFP_KERNEL);
+	if (!(*out_str))
+		return NULL;
 
 	n += snprintf(*out_str + n, tmp_str_size - n, "|");
 



[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