The patch titled Subject: mm/mmap.c: do not initialize retval in mmap_pgoff() has been added to the -mm tree. Its filename is mm-mmapc-do-not-initialize-retval-in-mmap_pgoff.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mmapc-do-not-initialize-retval-in-mmap_pgoff.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mmapc-do-not-initialize-retval-in-mmap_pgoff.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Chen Gang <xili_gchen_5257@xxxxxxxxxxx> Subject: mm/mmap.c: do not initialize retval in mmap_pgoff() When fget() fails we can return -EBADF directly. Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx> Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -puN mm/mmap.c~mm-mmapc-do-not-initialize-retval-in-mmap_pgoff mm/mmap.c --- a/mm/mmap.c~mm-mmapc-do-not-initialize-retval-in-mmap_pgoff +++ a/mm/mmap.c @@ -1412,13 +1412,13 @@ SYSCALL_DEFINE6(mmap_pgoff, unsigned lon unsigned long, fd, unsigned long, pgoff) { struct file *file = NULL; - unsigned long retval = -EBADF; + unsigned long retval; if (!(flags & MAP_ANONYMOUS)) { audit_mmap_fd(fd, flags); file = fget(fd); if (!file) - goto out; + return -EBADF; if (is_file_hugepages(file)) len = ALIGN(len, huge_page_size(hstate_file(file))); retval = -EINVAL; @@ -1453,7 +1453,6 @@ SYSCALL_DEFINE6(mmap_pgoff, unsigned lon out_fput: if (file) fput(file); -out: return retval; } _ Patches currently in -mm which might be from xili_gchen_5257@xxxxxxxxxxx are mm-mmapc-remove-redundant-statement-error-=-enomem.patch mm-mmapc-do-not-initialize-retval-in-mmap_pgoff.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html