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: <20120710010910.GA7362@shangw>
Date:	Tue, 10 Jul 2012 09:09:10 +0800
From:	Gavin Shan <shangw@...ux.vnet.ibm.com>
To:	Wanpeng Li <liwp.linux@...il.com>
Cc:	linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	William Irwin <wli@...omorphy.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: fix error code in hugetlbfs_alloc_inode

On Tue, Jul 10, 2012 at 09:03:04AM +0800, Wanpeng Li wrote:
>From: Wanpeng Li <liwp@...ux.vnet.ibm.com>
>
>When kmem_cache_alloc fails alloc slab object from
>hugetlbfs_inode_cachep, return -ENOMEM in usual. But
>hugetlbfs_alloc_inode implementation has inconsitency
>with it and returns NULL. Fix it to return -ENOMEM.
>
>Signed-off-by: Wanpeng Li <liwp.linux@...il.com>
>---
> fs/hugetlbfs/inode.c |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
>index c4b85d0..79a0f33 100644
>--- a/fs/hugetlbfs/inode.c
>+++ b/fs/hugetlbfs/inode.c
>@@ -696,7 +696,7 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
> 	p = kmem_cache_alloc(hugetlbfs_inode_cachep, GFP_KERNEL);
> 	if (unlikely(!p)) {
> 		hugetlbfs_inc_free_inodes(sbinfo);
>-		return NULL;
>+		return -ENOMEM;

The function is expecting "struct inode *", man.

static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)

Thanks,
Gavin

> 	}
> 	return &p->vfs_inode;
> }
>-- 
>1.7.5.4
>
>--
>To unsubscribe, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@...ck.org.  For more info on Linux MM,
>see: http://www.linux-mm.org/ .
>Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>
>

--
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