Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1471537
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 5/5] net/xgene: fix error handling during reset |
| Date | 2016-08-29 06:40 +0200 |
| Message-ID | <sbmwx-2H5-9@gated-at.bofh.it> (permalink) |
| References | <sareW-qT-7@gated-at.bofh.it> <sareW-qT-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 5/5] net/xgene: fix error handling during reset Arnd Bergmann <arnd@arndb.de> - 2016-08-26 17:30 +0200 Re: [PATCH 5/5] net/xgene: fix error handling during reset David Miller <davem@davemloft.net> - 2016-08-29 06:40 +0200
csiph-web