projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3052636
)
x86/mm: Refine mmap syscall implementation
author
Adrian Huang
<ahuang12@lenovo.com>
Thu, 17 Dec 2020 05:26:48 +0000
(13:26 +0800)
committer
Borislav Petkov
<bp@suse.de>
Tue, 5 Jan 2021 18:07:42 +0000
(19:07 +0100)
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@lenovo.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link:
https://lkml.kernel.org/r/20201217052648.24656-1-adrianhuang0701@gmail.com
arch/x86/kernel/sys_x86_64.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/sys_x86_64.c
b/arch/x86/kernel/sys_x86_64.c
index 504fa5425bcecb3fd8ed05de0dc18cc0abe30142..660b78827638fd946ed2d538c30d1896eb9156d8 100644
(file)
--- 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,