net: thunderx: Fix error return code in nicvf_open()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 11 Jan 2017 16:32:51 +0000 (16:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jan 2017 21:12:01 +0000 (16:12 -0500)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 712c31853440 ("net: thunderx: Program LMAC credits based on MTU")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nicvf_main.c

index 273eafdb1c5750e724eb70ec641aa971750273e6..a25bb6ea2ff44a1d6c3994aa7f9e2109ab57caa3 100644 (file)
@@ -1274,7 +1274,8 @@ int nicvf_open(struct net_device *netdev)
        /* Configure receive side scaling and MTU */
        if (!nic->sqs_mode) {
                nicvf_rss_init(nic);
-               if (nicvf_update_hw_max_frs(nic, netdev->mtu))
+               err = nicvf_update_hw_max_frs(nic, netdev->mtu);
+               if (err)
                        goto cleanup;
 
                /* Clear percpu stats */