From: Arnd Bergmann <arnd@arndb.de>
To: gregkh@linuxfoundation.org
Cc: Jiri Slaby <jslaby@suse.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Chen Jun <jun.d.chen@intel.com>, channing <chao.bi@intel.com>,
Russ Gorby <russ.gorby@intel.com>,
Vasiliy Kulikov <segoon@openwall.com>
Subject: Re: [PATCH] serial: ifx6x60: avoid uninitialized variable use
Date: Wed, 25 Nov 2015 11:07 +0100 [thread overview]
Message-ID: <6445070.Vs3hNH0JSm@wuerfel> (raw)
In-Reply-To: <3244991.qANsXoqoKs@wuerfel>
On Tuesday 24 November 2015 23:04:00 Arnd Bergmann 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.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Cc everyone who contributed non-cleanup patches to this driver,
> maybe someone has more insight into the operation of the driver than
> I have and can comment on whether this is the right fix or not.
Grmbl. Please don't apply this version for now.
The patch fixes one issue and made the warning go away in some
configurations, but my randconfig tests still show the same warning
in other configurations, as there is a second way that the 'more'
variable ends up being referenced without being initialized.
Let's wait for comments first, but I assume we will have to initialize
the 'more' variable as well, or possibly that function needs to
be rewritten.
Arnd
next prev parent reply other threads:[~2015-11-25 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 22:04 [PATCH] serial: ifx6x60: avoid uninitialized variable use Arnd Bergmann
2015-11-25 10:07 ` Arnd Bergmann [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-25 20:47 Arnd Bergmann
2016-02-26 0:06 ` One Thousand Gnomes
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=6445070.Vs3hNH0JSm@wuerfel \
--to=arnd@arndb.de \
--cc=chao.bi@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=jun.d.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=russ.gorby@intel.com \
--cc=segoon@openwall.com \
/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