We accidentally return success instead of -ENOMEM here.
Fixes: fe56b9e6a8d9 ('qed: Add module with basic common support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com
Signed-off-by: David S. Miller <davem@davemloft.net>
if (!p_hwfn->p_tx_cids) {
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Tx Cids\n");
if (!p_hwfn->p_tx_cids) {
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Tx Cids\n");
if (!p_hwfn->p_rx_cids) {
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Rx Cids\n");
if (!p_hwfn->p_rx_cids) {
DP_NOTICE(p_hwfn,
"Failed to allocate memory for Rx Cids\n");
/* EQ */
p_eq = qed_eq_alloc(p_hwfn, 256);
/* EQ */
p_eq = qed_eq_alloc(p_hwfn, 256);
+ if (!p_eq) {
+ rc = -ENOMEM;
p_hwfn->p_eq = p_eq;
p_consq = qed_consq_alloc(p_hwfn);
p_hwfn->p_eq = p_eq;
p_consq = qed_consq_alloc(p_hwfn);
+ if (!p_consq) {
+ rc = -ENOMEM;
p_hwfn->p_consq = p_consq;
/* DMA info initialization */
p_hwfn->p_consq = p_consq;
/* DMA info initialization */
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
if (!cdev->reset_stats) {
DP_NOTICE(cdev, "Failed to allocate reset statistics\n");
cdev->reset_stats = kzalloc(sizeof(*cdev->reset_stats), GFP_KERNEL);
if (!cdev->reset_stats) {
DP_NOTICE(cdev, "Failed to allocate reset statistics\n");