[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <160987128790.414.308593720085652897.tip-bot2@tip-bot2>
Date: Tue, 05 Jan 2021 18:28:07 -0000
From: "tip-bot2 for Adrian Huang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Adrian Huang <ahuang12@...ovo.com>, Borislav Petkov <bp@...e.de>,
Christoph Hellwig <hch@....de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: x86/cleanups] x86/mm: Refine mmap syscall implementation
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 91a8f6cb06b33adc79fbf5f7381d907485767c00
Gitweb: https://git.kernel.org/tip/91a8f6cb06b33adc79fbf5f7381d907485767c00
Author: Adrian Huang <ahuang12@...ovo.com>
AuthorDate: Thu, 17 Dec 2020 13:26:48 +08:00
Committer: Borislav Petkov <bp@...e.de>
CommitterDate: Tue, 05 Jan 2021 19:07:42 +01:00
x86/mm: Refine mmap syscall implementation
It is unnecessary to use the local variable 'error' in the mmap syscall
implementation function - just return -EINVAL directly and get rid of
the local variable altogether.
[ bp: Massage commit message. ]
Signed-off-by: Adrian Huang <ahuang12@...ovo.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Christoph Hellwig <hch@....de>
Link: https://lkml.kernel.org/r/20201217052648.24656-1-adrianhuang0701@gmail.com
---
arch/x86/kernel/sys_x86_64.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index 504fa54..660b788 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -90,14 +90,10 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags,
unsigned long, fd, unsigned long, off)
{
- long error;
- error = -EINVAL;
if (off & ~PAGE_MASK)
- goto out;
+ return -EINVAL;
- error = ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
-out:
- return error;
+ return ksys_mmap_pgoff(addr, len, prot, flags, fd, off >> PAGE_SHIFT);
}
static void find_start_end(unsigned long addr, unsigned long flags,
Powered by blists - more mailing lists