summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2016-07-08 17:42:48 +0200
committerDavid S. Miller <davem@davemloft.net>2016-07-11 21:41:36 +0200
commitf3ea3119ad75dde0ba3e8da4653dbd5a189688e5 (patch)
tree75eb383a9cf22924d17d5067f1074d1b84d8e2d0 /drivers/net/ethernet/broadcom
parentMerge tag 'batadv-net-for-davem-20160708' of git://git.open-mesh.org/linux-merge (diff)
downloadlinux-f3ea3119ad75dde0ba3e8da4653dbd5a189688e5.tar.xz
linux-f3ea3119ad75dde0ba3e8da4653dbd5a189688e5.zip
bnxt_en: initialize rc to zero to avoid returning garbage
rc is not initialized so it can contain garbage if it is not set by the call to bnxt_read_sfp_module_eeprom_info. Ensure garbage is not returned by initializing rc to 0. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index a38cb047b540..1b0ae4a72e9e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1591,7 +1591,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
{
struct bnxt *bp = netdev_priv(dev);
u16 start = eeprom->offset, length = eeprom->len;
- int rc;
+ int rc = 0;
memset(data, 0, eeprom->len);