cxgb4: Fix an error code in cxgb4_mqprio_alloc_hw_resources()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Nov 2019 18:25:48 +0000 (21:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Nov 2019 22:33:25 +0000 (14:33 -0800)
"ret" is zero or possibly uninitialized on this error path.  It
should be a negative error code instead.

Fixes: 2d0cb84dd973 ("cxgb4: add ETHOFLD hardware queue support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c

index 388078488fb5cfa3c66878406403cdbbff6f3f72..ce442c63f496cc93583eadf13a9dffa96cb4030e 100644 (file)
@@ -158,8 +158,10 @@ static int cxgb4_mqprio_alloc_hw_resources(struct net_device *dev)
                /* Allocate Rxqs for receiving ETHOFLD Tx completions */
                if (msix >= 0) {
                        msix = cxgb4_get_msix_idx_from_bmap(adap);
-                       if (msix < 0)
+                       if (msix < 0) {
+                               ret = msix;
                                goto out_free_queues;
+                       }
 
                        eorxq->msix = &adap->msix_info[msix];
                        snprintf(eorxq->msix->desc,