From: gnomes@lxorguk.ukuu.org.uk (One Thousand Gnomes)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] serial: ifx6x60: avoid uninitialized variable use
Date: Fri, 26 Feb 2016 00:06:51 +0000 [thread overview]
Message-ID: <20160226000651.628e28fe@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1456433283-3761559-1-git-send-email-arnd@arndb.de>
On Thu, 25 Feb 2016 21:47:57 +0100
Arnd Bergmann <arnd@arndb.de> wrote:
> gcc warns about a potential use of an uninitialized variable in this driver:
>
> drivers/tty/serial/ifx6x60.c: In function 'ifx_spi_complete':
> drivers/tty/serial/ifx6x60.c:713:6: warning: 'more' may be used uninitialized in this function [-Wmaybe-uninitialized]
> if (more || ifx_dev->spi_more || queue_length > 0 ||
>
> Unlike a lot of other such warnings, this one is correct and describes
> an actual problem in the handling of the "IFX_SPI_HEADER_F" result code.
>
> This appears to be a result from a restructuring of the driver that
> dates back to before it was merged in the kernel, so it's impossible
> to know where it went wrong. I also don't know what that result code
> means, so I have no idea if setting 'more' to zero is the correct
> solution, but at least it makes the behavior reproducible rather than
> depending on whatever happens to be on the kernel stack.
Would it not be far simpler just to set more = 0 at the top of
ifx_spi_complete ?
next prev parent reply other threads:[~2016-02-26 0:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 20:47 [PATCH] serial: ifx6x60: avoid uninitialized variable use Arnd Bergmann
2016-02-26 0:06 ` One Thousand Gnomes [this message]
2016-02-26 13:54 ` Arnd Bergmann
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=20160226000651.628e28fe@lxorguk.ukuu.org.uk \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-arm-kernel@lists.infradead.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