drivers/media/video/videocodec.c: check kmalloc() return value.
PATCH 1/1 drivers/media/video/videocodec.c: check kmalloc() return value.
Description: Check the return value of kmalloc() in function videocodec_build_table(), in file drivers/media/video/videocodec.c.
drivers/media/video/videocodec.c +2 -0
@@ -348,6 +348,8 @@ #define LINESIZE 100kfree (videocodec_buf); videocodec_buf = (char *)kmalloc (size,GFP_KERNEL ); +if (!videocodec_buf) +return 0 ; i =0 ; i +=scnprintf (videocodec_buf + i, size -1 ,"<S>lave or attached <M>aster name type flags magic " );
Quoted 9 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionvideocodec_build_table(), in filedrivers/media/video/videocodec.c.Signed-off-by Amit Choudhary <[email protected]>drivers/media/video/videocodec.c +0
-0
drivers/media/video/videocodec.c #define LINESIZE 100 · line 355
Quoted 8 lines
drivers/media/video/videocodec.c +2
-0@@ -348,6 +348,8 @@ #define LINESIZE 100kfree (videocodec_buf); videocodec_buf = (char *)kmalloc (size,GFP_KERNEL ); +if (!videocodec_buf) +return 0 ; i =0 ; i +=scnprintf (videocodec_buf + i, size -1 ,"<S>lave or attached <M>aster name type flags magic " );
Can you also remove useless (char *) cast above ?
Signature · 2 lines
Andrey Panin | Linux and UNIX system administrator [email protected] | PGP key: wwwkeys.pgp.net
Hi Amit,
Quoted 2 lines · Amit Choudhary
Description: Check the return value of
kmalloc()in functionvideocodec_build_table(), in filedrivers/media/video/videocodec.c.
No need for `Description:'. This line is automatically put in the logs as a patch description if the patch got accepted.
It's better not to use very large lines.
Also there's no need to specify the exact function in the log, it's already displayed in the patch.
Quoted 3 lines
Signed-off-by Amit Choudhary <[email protected]>
As said in Documentation/SubmittingPatches put a "---" line after Signed-off-by signature.
Thanks,
Signature · 2 lines
Ahmed S. Darwish http://darwish.07.googlepages.com