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 <ivec...@redhat.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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html