linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org
Subject: [bug report] mm-add-apply_to_existing_pages-helper-fix
Date: Thu, 12 Dec 2019 12:29:49 +0300	[thread overview]
Message-ID: <20191212092949.efpedkoshbehydfx@kili.mountain> (raw)

Hello Andrew Morton,

The patch 3264ba9274f5: "mm-add-apply_to_existing_pages-helper-fix"
from Dec 11, 2019, leads to the following static checker warning:

	mm/memory.c:2166 __apply_to_page_range()
	error: uninitialized symbol 'err'.

mm/memory.c
  2144  static int __apply_to_page_range(struct mm_struct *mm, unsigned long addr,
  2145                                   unsigned long size, pte_fn_t fn,
  2146                                   void *data, bool create)
  2147  {
  2148          pgd_t *pgd;
  2149          unsigned long next;
  2150          unsigned long end = addr + size;
  2151          int err;
  2152  
  2153          if (WARN_ON(addr >= end))
  2154                  return -EINVAL;
  2155  
  2156          pgd = pgd_offset(mm, addr);
  2157          do {
  2158                  next = pgd_addr_end(addr, end);
  2159                  if (!create && pgd_none_or_clear_bad(pgd))
  2160                          continue;
                                ^^^^^^^^^
It feels unlikely that we would always hit this continue but Smatch
complains.

  2161                  err = apply_to_p4d_range(mm, pgd, addr, next, fn, data, create);
  2162                  if (err)
  2163                          break;
  2164          } while (pgd++, addr = next, addr != end);
  2165  
  2166          return err;
  2167  }

regards,
dan carpenter


             reply	other threads:[~2019-12-12  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12  9:29 Dan Carpenter [this message]
2019-12-13  1:03 ` Andrew Morton
2019-12-13  2:04   ` Daniel Axtens

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=20191212092949.efpedkoshbehydfx@kili.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    /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