Skip to content

Commit

Permalink
qed: fix error return code in qed_iwarp_ll2_start()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 469981b ("qed: Add unaligned and packed packet processing")
Fixes: fcb39f6 ("qed: Add mpa buffer descriptors for storing and processing mpa fpdus")
Fixes: 1e28eaa ("qed: Add iWARP support for fpdu spanned over more than two tcp packets")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
Link: https://lore.kernel.org/r/1605532033-27373-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Zhang Changzhong authored and kuba-moo committed Nov 17, 2020
1 parent d5bd32a commit cb47d16
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/ethernet/qlogic/qed/qed_iwarp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2754,14 +2754,18 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps,
sizeof(*iwarp_info->partial_fpdus),
GFP_KERNEL);
if (!iwarp_info->partial_fpdus)
if (!iwarp_info->partial_fpdus) {
rc = -ENOMEM;
goto err;
}

iwarp_info->max_num_partial_fpdus = (u16)p_hwfn->p_rdma_info->num_qps;

iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL);
if (!iwarp_info->mpa_intermediate_buf)
if (!iwarp_info->mpa_intermediate_buf) {
rc = -ENOMEM;
goto err;
}

/* The mpa_bufs array serves for pending RX packets received on the
* mpa ll2 that don't have place on the tx ring and require later
Expand All @@ -2771,8 +2775,10 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
iwarp_info->mpa_bufs = kcalloc(data.input.rx_num_desc,
sizeof(*iwarp_info->mpa_bufs),
GFP_KERNEL);
if (!iwarp_info->mpa_bufs)
if (!iwarp_info->mpa_bufs) {
rc = -ENOMEM;
goto err;
}

INIT_LIST_HEAD(&iwarp_info->mpa_buf_pending_list);
INIT_LIST_HEAD(&iwarp_info->mpa_buf_list);
Expand Down

0 comments on commit cb47d16

Please sign in to comment.