linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-mm@kvack.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] mm/mmap: delete dead code in do_brk_flags()
Date: Thu, 28 Apr 2022 15:25:18 +0300	[thread overview]
Message-ID: <YmqHrpo/cBBq6lHf@kili> (raw)

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(-)

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;
-- 
2.35.1



             reply	other threads:[~2022-04-28 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 12:25 Dan Carpenter [this message]
2022-04-28 15:59 ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmqHrpo/cBBq6lHf@kili \
    --to=dan.carpenter@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox