Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1439602 > unrolled thread

[PATCH] bnxt_en: initialize rc to zero to avoid returning garbage

Started byColin King <colin.king@canonical.com>
First post2016-07-08 17:50 +0200
Last post2016-07-11 21:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Colin King <colin.king@canonical.com> - 2016-07-08 17:50 +0200
    Re: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Michael Chan <michael.chan@broadcom.com> - 2016-07-08 22:10 +0200
    Re: [PATCH] bnxt_en: initialize rc to zero to avoid returning  garbage David Miller <davem@davemloft.net> - 2016-07-11 21:50 +0200

#1439602 — [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage

FromColin King <colin.king@canonical.com>
Date2016-07-08 17:50 +0200
Subject[PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
Message-ID<rSGcq-6ES-31@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 0f7dd86..64466f5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1684,7 +1684,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);
 
-- 
2.8.1

[toc] | [next] | [standalone]


#1439775

FromMichael Chan <michael.chan@broadcom.com>
Date2016-07-08 22:10 +0200
Message-ID<rSKg2-14j-17@gated-at.bofh.it>
In reply to#1439602
On Fri, Jul 8, 2016 at 8:42 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>

Thanks.

Acked-by: Michael Chan <michael.chan@broadcom.com>

[toc] | [prev] | [next] | [standalone]


#1440847 — Re: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage

FromDavid Miller <davem@davemloft.net>
Date2016-07-11 21:50 +0200
SubjectRe: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
Message-ID<rTPnk-30E-27@gated-at.bofh.it>
In reply to#1439602
From: Colin King <colin.king@canonical.com>
Date: Fri,  8 Jul 2016 16:42:48 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> 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>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web