[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1447408361-7498-1-git-send-email-ivecera@redhat.com>
Date: Fri, 13 Nov 2015 10:52:41 +0100
From: Ivan Vecera <ivecera@...hat.com>
To: netdev@...r.kernel.org
Cc: sriharsha.basavapatna@...gotech.com, sathya.perla@...gotech.com,
ajit.khaparde@...gotech.com, padmanabh.ratnakar@...gotech.com
Subject: [PATCH net] be2net: check properly status in lancer_cmd_get_file_len()
The lancer_cmd_get_file_len() calls lancer_cmd_read_object() to get
the current size of registers for ethtool registers dump. The size
is stored in data_read but only when the returned status is 0 otherwise
it is uninitialized thus random.
Signed-off-by: Ivan Vecera <ivecera@...hat.com>
---
drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index f4cb8e4..26b6192 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -248,6 +248,8 @@ static u32 lancer_cmd_get_file_len(struct be_adapter *adapter, u8 *file_name)
status = lancer_cmd_read_object(adapter, &data_len_cmd, 0, 0,
file_name, &data_read, &eof,
&addn_status);
+ if (status)
+ return 0;
return data_read;
}
--
2.4.10
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists