public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>, David Lin <dtwlin@gmail.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Axel Haslam <ahaslam@baylibre.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	greybus-dev@lists.linaro.org,
	Greg Kroah-Hartman <gregkh@google.com>,
	Johan Hovold <johan@hovoldconsulting.com>
Subject: Re: [greybus-dev] [PATCH] greybus: uart: fix uninitialized flow control variable
Date: Thu, 14 May 2020 09:04:44 +0200	[thread overview]
Message-ID: <20200514070444.GB25962@localhost> (raw)
In-Reply-To: <7146e1ca-1fc7-61ab-e798-7b017c7c974b@linaro.org>

On Wed, Apr 29, 2020 at 03:00:44PM -0500, Alex Elder wrote:
> On 4/29/20 2:00 PM, Arnd Bergmann wrote:
> > gcc-10 points out an uninitialized variable use:
> 
> Wow, nice, checking individual uninitialized fields within
> the structure.
> 
> The structure should really be zero-initialized anyway; it's
> passed as a structure in a message elsewhere.  With your
> change, all fields in the structure are written, but in
> theory the structure could change and stack garbage could
> be sent over the wire.
> 
> What do you think of doing this instead?  Or in addition?
> 
>         struct gb_tty_line_coding newline = { };
> 
> (Presumably that would also silence the warning.)
> 
> I endorse of your change, either way.

Looks like Greg ended up applying an identical version of this patch
that was submitted this week instead.

Taking a closer look at this code I noticed we have two versions of this
line-coding struct which are supposed by be identical, but which could
get out of sync (and have once already it turns out).

Johan

      reply	other threads:[~2020-05-14  7:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 19:00 [PATCH] greybus: uart: fix uninitialized flow control variable Arnd Bergmann
2020-04-29 20:00 ` [greybus-dev] " Alex Elder
2020-05-14  7:04   ` Johan Hovold [this message]

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=20200514070444.GB25962@localhost \
    --to=johan@kernel.org \
    --cc=ahaslam@baylibre.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=dtwlin@gmail.com \
    --cc=elder@kernel.org \
    --cc=elder@linaro.org \
    --cc=gregkh@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@hovoldconsulting.com \
    --cc=linux-kernel@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