public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] powerpc/prom: Avoid reference to potentially freed memory
Date: Fri, 16 Oct 2015 07:50:24 +0000	[thread overview]
Message-ID: <201510161538.2cFpVldH%fengguang.wu@intel.com> (raw)
In-Reply-To: <1444976055-19148-1-git-send-email-christophe.jaillet@wanadoo.fr>

[-- Attachment #1: Type: text/plain, Size: 3467 bytes --]

Hi Christophe,

[auto build test ERROR on powerpc/next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Christophe-JAILLET/powerpc-prom-Avoid-reference-to-potentially-freed-memory/20151016-141714
config: powerpc-defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   arch/powerpc/kernel/prom.c: In function 'of_get_ibm_chip_id':
>> arch/powerpc/kernel/prom.c:787:23: error: unused variable 'old' [-Werror=unused-variable]
      struct device_node *old = np;
                          ^
>> arch/powerpc/kernel/prom.c:795:15: error: 'old' undeclared (first use in this function)
      of_node_put(old);
                  ^
   arch/powerpc/kernel/prom.c:795:15: note: each undeclared identifier is reported only once for each function it appears in
   arch/powerpc/kernel/prom.c: At top level:
>> arch/powerpc/kernel/prom.c:797:2: error: expected identifier or '(' before 'return'
     return -1;
     ^
>> arch/powerpc/kernel/prom.c:798:1: error: expected identifier or '(' before '}' token
    }
    ^
   arch/powerpc/kernel/prom.c: In function 'of_get_ibm_chip_id':
   arch/powerpc/kernel/prom.c:796:2: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
   cc1: all warnings being treated as errors

vim +/old +787 arch/powerpc/kernel/prom.c

b37193b7 Benjamin Herrenschmidt 2013-07-15  781   * be found.
b37193b7 Benjamin Herrenschmidt 2013-07-15  782   */
b37193b7 Benjamin Herrenschmidt 2013-07-15  783  int of_get_ibm_chip_id(struct device_node *np)
b37193b7 Benjamin Herrenschmidt 2013-07-15  784  {
b37193b7 Benjamin Herrenschmidt 2013-07-15  785  	of_node_get(np);
b37193b7 Benjamin Herrenschmidt 2013-07-15  786  	while (np) {
b37193b7 Benjamin Herrenschmidt 2013-07-15 @787  		struct device_node *old = np;
12540384 Christophe JAILLET     2015-10-16  788  		u32 chip_id;
b37193b7 Benjamin Herrenschmidt 2013-07-15  789  
12540384 Christophe JAILLET     2015-10-16  790  		if (!of_property_read_u32(np, "ibm,chip-id", &chip_id))
b37193b7 Benjamin Herrenschmidt 2013-07-15  791  			of_node_put(np);
12540384 Christophe JAILLET     2015-10-16  792  			return chip_id;
b37193b7 Benjamin Herrenschmidt 2013-07-15  793  		}
b37193b7 Benjamin Herrenschmidt 2013-07-15  794  		np = of_get_parent(np);
b37193b7 Benjamin Herrenschmidt 2013-07-15 @795  		of_node_put(old);
b37193b7 Benjamin Herrenschmidt 2013-07-15  796  	}
b37193b7 Benjamin Herrenschmidt 2013-07-15 @797  	return -1;
b37193b7 Benjamin Herrenschmidt 2013-07-15 @798  }
b130e7c0 Dan Streetman          2015-05-07  799  EXPORT_SYMBOL(of_get_ibm_chip_id);
b37193b7 Benjamin Herrenschmidt 2013-07-15  800  
3eb906c6 Michael Ellerman       2013-11-20  801  /**

:::::: The code at line 787 was first introduced by commit
:::::: b37193b71846858d816e152d3a5db010d7b73f5e powerpc/powernv: Add helper to get ibm,chip-id of a node

:::::: TO: Benjamin Herrenschmidt <benh@kernel.crashing.org>
:::::: CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 21508 bytes --]

  reply	other threads:[~2015-10-16  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  6:14 [PATCH] powerpc/prom: Avoid reference to potentially freed memory Christophe JAILLET
2015-10-16  7:50 ` kbuild test robot [this message]
2015-10-16 10:02 ` Michael Ellerman
2015-10-16 20:09   ` Christophe JAILLET
2015-10-19  9:32     ` Michael Ellerman
2015-10-16 21:38 ` [PATCH v2] " Christophe JAILLET
2015-10-19  9:27   ` Michael Ellerman
2015-10-21  4:36     ` [PATCH v3] " Christophe JAILLET
2015-10-21 11:41   ` [v2] " Michael Ellerman

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=201510161538.2cFpVldH%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=kernel-janitors@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