Skip to content

Commit cb47d16

Browse files
Zhang Changzhongkuba-moo
authored andcommitted
qed: fix error return code in qed_iwarp_ll2_start()
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>
1 parent d5bd32a commit cb47d16

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/net/ethernet/qlogic/qed/qed_iwarp.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,14 +2754,18 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_hwfn,
27542754
iwarp_info->partial_fpdus = kcalloc((u16)p_hwfn->p_rdma_info->num_qps,
27552755
sizeof(*iwarp_info->partial_fpdus),
27562756
GFP_KERNEL);
2757-
if (!iwarp_info->partial_fpdus)
2757+
if (!iwarp_info->partial_fpdus) {
2758+
rc = -ENOMEM;
27582759
goto err;
2760+
}
27592761

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

27622764
iwarp_info->mpa_intermediate_buf = kzalloc(buff_size, GFP_KERNEL);
2763-
if (!iwarp_info->mpa_intermediate_buf)
2765+
if (!iwarp_info->mpa_intermediate_buf) {
2766+
rc = -ENOMEM;
27642767
goto err;
2768+
}
27652769

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

27772783
INIT_LIST_HEAD(&iwarp_info->mpa_buf_pending_list);
27782784
INIT_LIST_HEAD(&iwarp_info->mpa_buf_list);

0 commit comments

Comments
 (0)