The patch titled Subject: mm/mmap.c: brk: fix unsigned compare against 0 issue has been removed from the -mm tree. Its filename was mm-brk-downgrade-mmap_sem-to-read-when-shrinking-fix-2.patch This patch was dropped because it was folded into mm-brk-downgrade-mmap_sem-to-read-when-shrinking.patch ------------------------------------------------------ From: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> Subject: mm/mmap.c: brk: fix unsigned compare against 0 issue Static analysis reported an unsigned compare against 0 issue. Define an int temp variable to check the return value of __do_munmap(). Link: http://lkml.kernel.org/r/1538687672-17795-1-git-send-email-yang.shi@xxxxxxxxxxxxxxxxx Reported-by: Colin Ian King <colin.king@xxxxxxxxxxxxx> Signed-off-by: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Laurent Dufour <ldufour@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- --- a/mm/mmap.c~mm-brk-downgrade-mmap_sem-to-read-when-shrinking-fix-2 +++ a/mm/mmap.c @@ -242,18 +242,21 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) * __do_munmap() may downgrade mmap_sem to read. */ if (brk <= mm->brk) { + int ret; + /* * mm->brk must to be protected by write mmap_sem so update it * before downgrading mmap_sem. When __do_munmap() fails, * mm->brk will be restored from origbrk. */ mm->brk = brk; - retval = __do_munmap(mm, newbrk, oldbrk-newbrk, &uf, true); - if (retval < 0) { + ret = __do_munmap(mm, newbrk, oldbrk-newbrk, &uf, true); + if (ret < 0) { mm->brk = origbrk; goto out; - } else if (retval == 1) + } else if (ret == 1) { downgraded = true; + } goto success; } _ Patches currently in -mm which might be from yang.shi@xxxxxxxxxxxxxxxxx are mm-mmap-zap-pages-with-read-mmap_sem-in-munmap.patch mm-unmap-vm_hugetlb-mappings-with-optimized-path.patch mm-unmap-vm_pfnmap-mappings-with-optimized-path.patch mm-mremap-downgrade-mmap_sem-to-read-when-shrinking.patch mm-brk-downgrade-mmap_sem-to-read-when-shrinking.patch mm-dax-add-comment-for-pfn_special.patch