linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	fchen@apm.com, isubramanian@apm.com, kchudgar@apm.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH 5/5] net/xgene: fix error handling during reset
Date: Mon, 29 Aug 2016 00:31:05 -0400 (EDT)	[thread overview]
Message-ID: <20160829.003105.1844403424202906526.davem@davemloft.net> (raw)
In-Reply-To: <20160826152546.604384-6-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 26 Aug 2016 17:25:46 +0200

> The newly added reset logic uses helper functions for the MMIO that
> may fail. However, when the read operation fails, we end up writing
> back uninitialized data to the register, as gcc warns:
> 
> drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c: In function 'xgene_enet_link_state':
> drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:213:2: error: 'data' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/net/ethernet/apm/xgene/xgene_enet_xgmac.c:209:6: note: 'data' was declared here
>   u32 data;
> 
> We already print a warning to the console log if that happens,
> the best alternative that I can see is skip the rest of the reset
> sequence if the register value cannot be read: Most likely the
> write would fail as well, and if it succeeded, worse things could
> happen.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 3eb7cb9dc946 ("drivers: net: xgene: XFI PCS reset when link is down")

Applied.

  reply	other threads:[~2016-08-29  4:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 15:25 [PATCH 0/5] -Wmaybe-uninitialized bug fixes for linux-next Arnd Bergmann
2016-08-26 15:25 ` [PATCH 1/5] gpio: pca954x: fix undefined error code from remove Arnd Bergmann
2016-08-26 15:47   ` Phil Reid
2016-09-07 14:15   ` Linus Walleij
2016-08-26 15:25 ` [PATCH 2/5] video: ARM CLCD: fix endpoint lookup logic Arnd Bergmann
2016-08-29 13:18   ` Linus Walleij
2016-08-29 13:41     ` Arnd Bergmann
2016-08-30  8:35     ` Tomi Valkeinen
2016-08-26 15:25 ` [PATCH 3/5] rxrpc: fix last_call processing Arnd Bergmann
2016-08-26 15:25 ` [PATCH 4/5] net_sched: fix use of uninitialized ethertype variable in cls_flower Arnd Bergmann
2016-08-29  4:30   ` David Miller
2016-08-26 15:25 ` [PATCH 5/5] net/xgene: fix error handling during reset Arnd Bergmann
2016-08-29  4:31   ` David Miller [this message]
2016-08-27  7:01 ` [PATCH 3/5] rxrpc: fix last_call processing David Howells
2016-08-28  8:42 ` David Howells
2016-08-31 11:53   ` Arnd Bergmann
2016-08-31 20:58   ` David Howells

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=20160829.003105.1844403424202906526.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=arnd@arndb.de \
    --cc=fchen@apm.com \
    --cc=isubramanian@apm.com \
    --cc=kchudgar@apm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).