Commit 9b15acbf authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

qlogic: qed: fix error codes in qed_resc_alloc()

We accidentally return success instead of -ENOMEM here.

Fixes: fe56b9e6 ('qed: Add module with basic common support')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e79a8bcb
...@@ -223,6 +223,7 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -223,6 +223,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
if (!p_hwfn->p_tx_cids) { if (!p_hwfn->p_tx_cids) {
DP_NOTICE(p_hwfn, DP_NOTICE(p_hwfn,
"Failed to allocate memory for Tx Cids\n"); "Failed to allocate memory for Tx Cids\n");
rc = -ENOMEM;
goto alloc_err; goto alloc_err;
} }
...@@ -230,6 +231,7 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -230,6 +231,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
if (!p_hwfn->p_rx_cids) { if (!p_hwfn->p_rx_cids) {
DP_NOTICE(p_hwfn, DP_NOTICE(p_hwfn,
"Failed to allocate memory for Rx Cids\n"); "Failed to allocate memory for Rx Cids\n");
rc = -ENOMEM;
goto alloc_err; goto alloc_err;
} }
} }
...@@ -281,14 +283,17 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -281,14 +283,17 @@ int qed_resc_alloc(struct qed_dev *cdev)
/* EQ */ /* EQ */
p_eq = qed_eq_alloc(p_hwfn, 256); p_eq = qed_eq_alloc(p_hwfn, 256);
if (!p_eq) {
if (!p_eq) rc = -ENOMEM;
goto alloc_err; goto alloc_err;
}
p_hwfn->p_eq = p_eq; p_hwfn->p_eq = p_eq;
p_consq = qed_consq_alloc(p_hwfn); p_consq = qed_consq_alloc(p_hwfn);
if (!p_consq) if (!p_consq) {
rc = -ENOMEM;
goto alloc_err; goto alloc_err;
}
p_hwfn->p_consq = p_consq; p_hwfn->p_consq = p_consq;
/* DMA info initialization */ /* DMA info initialization */
...@@ -303,6 +308,7 @@ int qed_resc_alloc(struct qed_dev *cdev) ...@@ -303,6 +308,7 @@ int qed_resc_alloc(struct qed_dev *cdev)
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL); cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
if (!cdev->reset_stats) { if (!cdev->reset_stats) {
DP_NOTICE(cdev, "Failed to allocate reset statistics\n"); DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
rc = -ENOMEM;
goto alloc_err; goto alloc_err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment