Skip to contentSkip to conversation

net: thunderx: Fix error return code in nicvf_open()

PATCH Applied Wei Yongjun 2 participants 2 messages Jan 11, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: thunderx: Fix error return code in nicvf_open()

From: Wei Yongjun <[email protected]>

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")
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/cavium/thunder/nicvf_main.c +2 -1
index 273eafd..a25bb6e 100644
@@ -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 */