]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Fix error return code in qed_resc_alloc()
authorWei Yongjun <weiyj.lk@gmail.com>
Tue, 2 Aug 2016 00:55:34 +0000 (00:55 +0000)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 04:59:27 +0000 (20:59 -0800)
Orabug: 25477939

Fix to return error code -EINVAL instead of 0 when EQ elements is
too larger, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1b4985b5e8c308e0c2e2046f1bb8dc6180d45b9f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_dev.c

index 0b47ab5d6fd998958861230953f74458773e41bb..0e4f4a9306b55ac64173a7a1ce73ad0626e5a143 100644 (file)
@@ -509,6 +509,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
                        DP_ERR(p_hwfn,
                               "Cannot allocate 0x%x EQ elements. The maximum of a u16 chain is 0x%x\n",
                               n_eqes, 0xFFFF);
+                       rc = -EINVAL;
                        goto alloc_err;
                }