linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
@ 2016-07-08 15:42 Colin King
  2016-07-08 20:06 ` Michael Chan
  2016-07-11 19:42 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2016-07-08 15:42 UTC (permalink / raw)
  To: David S . Miller, Rob Swindell, Satish Baddipadige,
	Ajit Khaparde, netdev
  Cc: linux-kernel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
  2016-07-08 15:42 [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Colin King
@ 2016-07-08 20:06 ` Michael Chan
  2016-07-11 19:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Chan @ 2016-07-08 20:06 UTC (permalink / raw)
  To: Colin King
  Cc: David S . Miller, Rob Swindell, Satish Baddipadige,
	Ajit Khaparde, Netdev, linux-kernel

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage
  2016-07-08 15:42 [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Colin King
  2016-07-08 20:06 ` Michael Chan
@ 2016-07-11 19:42 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-07-11 19:42 UTC (permalink / raw)
  To: colin.king; +Cc: rob.swindell, sbaddipa, ajit.khaparde, netdev, linux-kernel

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-11 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 15:42 [PATCH] bnxt_en: initialize rc to zero to avoid returning garbage Colin King
2016-07-08 20:06 ` Michael Chan
2016-07-11 19:42 ` David Miller

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).