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: <1187929189.6406.2.camel@norville.austin.ibm.com>
Date:	Thu, 23 Aug 2007 23:19:49 -0500
From:	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
To:	Jesper Juhl <jesper.juhl@...il.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	jfs-discussion@...ts.sourceforge.net
Subject: Re: [PATCH 28/30] jfs: avoid pointless casts of kmalloc() return
	val

Thanks, but Jack Stone submitted the same patch a few weeks ago.  It's
already in the jfs git tree and the -mm kernel.

Shaggy

On Fri, 2007-08-24 at 02:36 +0200, Jesper Juhl wrote:
> There's no need to cast the, void *, return value of kmalloc() when
> assigning to a pointer variable.
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@...il.com>
> ---
>  fs/jfs/jfs_dtree.c |    8 ++------
>  1 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
> index c14ba3c..3f15b36 100644
> --- a/fs/jfs/jfs_dtree.c
> +++ b/fs/jfs/jfs_dtree.c
> @@ -592,9 +592,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
>  	struct component_name ciKey;
>  	struct super_block *sb = ip->i_sb;
>  
> -	ciKey.name =
> -	    (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
> -				GFP_NOFS);
> +	ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS);
>  	if (ciKey.name == 0) {
>  		rc = -ENOMEM;
>  		goto dtSearch_Exit2;
> @@ -957,9 +955,7 @@ static int dtSplitUp(tid_t tid,
>  	smp = split->mp;
>  	sp = DT_PAGE(ip, smp);
>  
> -	key.name =
> -	    (wchar_t *) kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t),
> -				GFP_NOFS);
> +	key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS);
>  	if (key.name == 0) {
>  		DT_PUTPAGE(smp);
>  		rc = -ENOMEM;
-- 
David Kleikamp
IBM Linux Technology Center

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ