Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758851AbbFBJJf (ORCPT ); Tue, 2 Jun 2015 05:09:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52199 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756143AbbFBJJV (ORCPT ); Tue, 2 Jun 2015 05:09:21 -0400 Date: Tue, 2 Jun 2015 11:09:18 +0200 From: Joerg Roedel To: Joerg Roedel Cc: Tony Luck , Fenghua Yu , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ia64: Return -ENOMEM in ia64_mmap_check() error case Message-ID: <20150602090918.GE16345@suse.de> References: <1431984439-15008-1-git-send-email-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431984439-15008-1-git-send-email-joro@8bytes.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1389 Lines: 42 Ping. Tony, Fenghua, any opinion on this? On Mon, May 18, 2015 at 11:27:19PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > The value -ENOMEM is the expected return code for mmap when > the address range verification failes on a MAP_FIXED > request, as stated in the specification: > > [ENOMEM] > MAP_FIXED was specified, and the range > [addr,addr+len) exceeds that allowed for the > address space of a process; > > The ia64_mmap_check() function is part of that verification > and should return -ENOMEM too. > > Signed-off-by: Joerg Roedel > --- > arch/ia64/kernel/sys_ia64.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c > index 41e33f8..e927023 100644 > --- a/arch/ia64/kernel/sys_ia64.c > +++ b/arch/ia64/kernel/sys_ia64.c > @@ -124,7 +124,7 @@ int ia64_mmap_check(unsigned long addr, unsigned long len, > */ > roff = REGION_OFFSET(addr); > if ((len > RGN_MAP_LIMIT) || (roff > (RGN_MAP_LIMIT - len))) > - return -EINVAL; > + return -ENOMEM; > return 0; > } > > -- > 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/