linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Hiep Cao Minh <cm-hiep@jinso.co.jp>
Cc: Mark Brown <broonie@kernel.org>,
	Chris Brandt <chris.brandt@renesas.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: rspi: avoid uninitialized variable access
Date: Thu, 10 Nov 2016 11:51:44 +0100	[thread overview]
Message-ID: <5755979.RXybIODAnf@wuerfel> (raw)
In-Reply-To: <58243D24.5080302@jinso.co.jp>

On Thursday, November 10, 2016 6:25:56 PM CET Hiep Cao Minh wrote:
> Hi Arnd,
> 
> Thanks for your fixed patch.
> 
> On 11/08/2016 10:46 PM, Arnd Bergmann wrote:
> > The newly introduced rspi_pio_transfer_in_or_our() function must
> > take either a valid 'rx' or 'tx' pointer, and has undefined behavior
> > if both are NULL, as found by 'gcc -Wmaybe-unintialized':
> >
> > drivers/spi/spi-rspi.c: In function 'rspi_pio_transfer_in_or_our':
> > drivers/spi/spi-rspi.c:558:5: error: 'len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> Could you tell me what kind of GCC are you using?
> I'd like to reproduce it on my environment, too.
> I am using the Linaro's gcc of 
> "gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux".
> But there is no error message like this on my environment.

The warning is currently disabled in mainline Linux, but I'm trying to
address this and hope to still get a revert of 6e8d666e9253 ("Disable
"maybe-uninitialized" warning globally") into v4.9.

You can build with "make EXTRA_CFLAGS=-Wmaybe-uninitialized" in
the meantime.

	Arnd

  reply	other threads:[~2016-11-10 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 13:46 [PATCH] spi: rspi: avoid uninitialized variable access Arnd Bergmann
2016-11-09 15:00 ` Applied "spi: rspi: avoid uninitialized variable access" to the spi tree Mark Brown
     [not found] ` <20161108134624.1905209-1-arnd-r2nGTMty4D4@public.gmane.org>
2016-11-08 17:20   ` [PATCH] spi: rspi: avoid uninitialized variable access Chris Brandt
     [not found]     ` <SG2PR06MB11655C10710B5FDDEAEA48218AA60-ESzmfEwOt/xoAsOJh7vwSm0DtJ1/0DrXvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-11-08 17:40       ` Mark Brown
2016-11-08 18:35     ` Geert Uytterhoeven
2016-11-10  9:25   ` Hiep Cao Minh
2016-11-10 10:51     ` Arnd Bergmann [this message]
2016-11-11  0:58       ` Hiep Cao Minh

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=5755979.RXybIODAnf@wuerfel \
    --to=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=chris.brandt@renesas.com \
    --cc=cm-hiep@jinso.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@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;
as well as URLs for NNTP newsgroup(s).