Ver Fonte

net: hns3: fix for returning wrong value problem in hns3_get_rss_key_size

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>
Fuyun Liang há 7 anos atrás
pai
commit
3bd6d258b1
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

+ 1 - 1
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

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