From: Jitendra Kalsaria Date: Tue, 10 Jul 2012 14:57:35 +0000 (+0000) Subject: qlge: Added missing case statement to ethtool get_strings. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a7db9ad1d48b502613f96054f21b107a8403237a;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git qlge: Added missing case statement to ethtool get_strings. Missing case was causing ethtool self test to print garbage value in extra info section. Signed-off-by: Jitendra Kalsaria Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c index 3b0912fb53ab..4c141da51a82 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_ethtool.c @@ -248,6 +248,9 @@ static char ql_stats_str_arr[][ETH_GSTRING_LEN] = { static void ql_get_strings(struct net_device *dev, u32 stringset, u8 *buf) { switch (stringset) { + case ETH_SS_TEST: + memcpy(buf, *ql_gstrings_test, QLGE_TEST_LEN * ETH_GSTRING_LEN); + break; case ETH_SS_STATS: memcpy(buf, ql_stats_str_arr, sizeof(ql_stats_str_arr)); break; @@ -531,6 +534,8 @@ static void ql_self_test(struct net_device *ndev, { struct ql_adapter *qdev = netdev_priv(ndev); + memset(data, 0, sizeof(u64) * QLGE_TEST_LEN); + if (netif_running(ndev)) { set_bit(QL_SELFTEST, &qdev->flags); if (eth_test->flags == ETH_TEST_FL_OFFLINE) {