diff mbox series

mm/mmap: delete dead code in do_brk_flags()

Message ID YmqHrpo/cBBq6lHf@kili (mailing list archive)
State New
Headers show
Series mm/mmap: delete dead code in do_brk_flags() | expand

Commit Message

Dan Carpenter April 28, 2022, 12:25 p.m. UTC
This code can't be reached.  It's harmless but it leads to a Smatch
warning:

    mm/mmap.c:3040 do_brk_flags() warn: ignoring unreachable code.

Fixes: d2bbe46ab3b9 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This doesn't fix a bug, but I added a Fixes tag so that it could be
folded in together with the original commit.

 mm/mmap.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Hildenbrand April 28, 2022, 3:59 p.m. UTC | #1
On 28.04.22 14:25, Dan Carpenter wrote:
> This code can't be reached.  It's harmless but it leads to a Smatch
> warning:
> 
>     mm/mmap.c:3040 do_brk_flags() warn: ignoring unreachable code.
> 
> Fixes: d2bbe46ab3b9 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/mmap.c b/mm/mmap.c
index b5c8f8c919c3..257858671618 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3037,7 +3037,6 @@  static int do_brk_flags(struct ma_state *mas, struct vm_area_struct *vma,
 	validate_mm(mm);
 	return 0;
 
-	vm_area_free(vma);
 vma_alloc_fail:
 	vm_unacct_memory(len >> PAGE_SHIFT);
 	return -ENOMEM;