net: hns3: fix for returning wrong value problem in hns3_get_rss_indir_size
authorFuyun Liang <liangfuyun1@huawei.com>
Sat, 24 Mar 2018 03:32:44 +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_indir_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 ac523c90d604fdbba9ee6c89e298d6715615499d..eb3c34f3cf87b93d80f5a28cfc6cca2b29672c75 100644 (file)
@@ -649,7 +649,7 @@ static u32 hns3_get_rss_indir_size(struct net_device *netdev)
 
        if (!h->ae_algo || !h->ae_algo->ops ||
            !h->ae_algo->ops->get_rss_indir_size)
-               return -EOPNOTSUPP;
+               return 0;
 
        return h->ae_algo->ops->get_rss_indir_size(h);
 }