net: hns3: fix for returning wrong value problem in hns3_get_rss_key_size
authorFuyun Liang <liangfuyun1@huawei.com>
Sat, 24 Mar 2018 03:32:43 +0000 (11:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Mar 2018 16:12:26 +0000 (12:12 -0400)
The return type of hns3_get_rss_key_size is u32. But a negative value is
returned. This patch fixes it by replacing the negative value with zero.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

index 9d07116a4426a351ad598c6c52c2a19a189bfdbc..ac523c90d604fdbba9ee6c89e298d6715615499d 100644 (file)
@@ -638,7 +638,7 @@ static u32 hns3_get_rss_key_size(struct net_device *netdev)
 
        if (!h->ae_algo || !h->ae_algo->ops ||
            !h->ae_algo->ops->get_rss_key_size)
-               return -EOPNOTSUPP;
+               return 0;
 
        return h->ae_algo->ops->get_rss_key_size(h);
 }