SUPERH platform development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-sh@vger.kernel.org
Subject: re: sh: Support for multiple nodes.
Date: Wed, 03 Dec 2014 12:39:55 +0000	[thread overview]
Message-ID: <20141203123954.GA16105@mwanda> (raw)

Hello Paul Mundt,

The patch b241cb0c885e: "sh: Support for multiple nodes." from Jun 6,
2007, leads to the following static checker warning:

	arch/sh/mm/numa.c:47 setup_bootmem_node()
	error: buffer overflow 'node_data' 1024 <= 1024

arch/sh/mm/numa.c
    27  void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
    28  {
    29          unsigned long bootmap_pages;
    30          unsigned long start_pfn, end_pfn;
    31          unsigned long bootmem_paddr;
    32  
    33          /* Don't allow bogus node assignment */
    34          BUG_ON(nid > MAX_NUMNODES || nid <= 0);
                       ^^^^^^^^^^^^^^^^^^

It's not very important but this check is off by one so static checkers
complain.

    35  
    36          start_pfn = start >> PAGE_SHIFT;
    37          end_pfn = end >> PAGE_SHIFT;
    38  
    39          pmb_bolt_mapping((unsigned long)__va(start), start, end - start,
    40                           PAGE_KERNEL);
    41  
    42          memblock_add(start, end - start);
    43  
    44          __add_active_range(nid, start_pfn, end_pfn);
    45  
    46          /* Node-local pgdat */
    47          NODE_DATA(nid) = __va(memblock_alloc_base(sizeof(struct pglist_data),
    48                                               SMP_CACHE_BYTES, end));
    49          memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
    50  

regards,
dan carpenter

             reply	other threads:[~2014-12-03 12:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 12:39 Dan Carpenter [this message]
2014-12-03 13:05 ` sh: Support for multiple nodes Geert Uytterhoeven
2014-12-04 11:01   ` [patch] sh: off by one BUG_ON() in setup_bootmem_node() Dan Carpenter
2014-12-04 11:04     ` Geert Uytterhoeven

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=20141203123954.GA16105@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-sh@vger.kernel.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