From: Fuyun Liang Date: Sat, 24 Mar 2018 03:32:43 +0000 (+0800) Subject: net: hns3: fix for returning wrong value problem in hns3_get_rss_key_size X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3bd6d258b1d5f76744567855d1376358a94f127d;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Peng Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 9d07116a4426..ac523c90d604 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/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 || !h->ae_algo->ops->get_rss_key_size) - return -EOPNOTSUPP; + return 0; return h->ae_algo->ops->get_rss_key_size(h); }