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: <20070309090411.GC18056@pazke.donpac.ru>
Date:	Fri, 9 Mar 2007 12:04:11 +0300
From:	Andrey Panin <pazke@...pac.ru>
To:	Amit Choudhary <amit2030@...il.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers/media/video/videocodec.c: check kmalloc() return value.

On 067, 03 08, 2007 at 11:14:01PM -0800, Amit Choudhary wrote:
> Description: Check the return value of kmalloc() in function videocodec_build_table(), in file drivers/media/video/videocodec.c.
> 
> Signed-off-by: Amit Choudhary <amit2030@...il.com>
> 
> diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c
> index 2ae3fb2..16fc1dd 100644
> --- a/drivers/media/video/videocodec.c
> +++ b/drivers/media/video/videocodec.c
> @@ -348,6 +348,8 @@ #define LINESIZE 100
>  	kfree(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 ?

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@...pac.ru		| PGP key: wwwkeys.pgp.net

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ