Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3069608pxb; Mon, 16 Nov 2020 05:10:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJV2zoZeXu/oAl61IxpbYcwVMA968NYKXpJHKqa4b2qAxgdCnwtA0rSkYVE4WVmanVuKI4 X-Received: by 2002:a17:906:944f:: with SMTP id z15mr15056855ejx.111.1605532199957; Mon, 16 Nov 2020 05:09:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605532199; cv=none; d=google.com; s=arc-20160816; b=asLxsLCXbnoGuniVRkKXIwJQYYL4jmo6vaBZcfHccc/ZSa777fEH/v5XemtIcgJ1Wr mDgs9hyaXjnhmlbF1bWUhndh1tF68OU+u7D/h3tprOtwgKiPPfwd0gA0is73xa5ohgyQ rrZzwjNw2RrjlP3HVmYYbzSDpU+LT9eifZJ4KF8Tid6M4AyVAVGod8OVf5L3/jBVhFRK Uu5zpfL0jjXZuvyyvFsB/VB8itVWNNE2/MrRn7z7OfCouT+YOYLz7DB+PVxCo22+9+Eb qsrFBye4jG9uXtETGKqHrC5cW5GpNBsrpdTalcVXzcZJOw91fTiPg7dIi6vpPcunowok pXgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=JSYNjNN7+GMjGYDUUpmj+QYhs05GgfXcDpilzMvNQDE=; b=gPp2mexlRj1yQY/zSOoyZHrNHJJEsk6+XCYQO3pN7cSLEnbeLO6ve0UlSCasWPyamX 0Qs9HVwtd2s1yreM/nTTQSfndQBnzfXG5KefvVmtCo7Y7D0HfTNj0s4xSZehzBEKMaTc w/V5vog3b7u5zQIQ6+o50VqjOxodDFvE2f2xKg6xfxyXLxzanOkur5Wwng+K91xURnek 3oz0ERg/8FfCHzzuswNuOhN/b5yRpMxlyrezoGhM4mWnBF/E/cPP/K2NICT3QbLc3yTv nSQ0DyHVNRN1T36EoM9eKReSPfSXHi1E/togcZusiKmYl0hdjoGMuO2C1CkgPt0pJ69/ so6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si11692886ejz.656.2020.11.16.05.09.36; Mon, 16 Nov 2020 05:09:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbgKPNFh (ORCPT + 99 others); Mon, 16 Nov 2020 08:05:37 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:7921 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbgKPNFh (ORCPT ); Mon, 16 Nov 2020 08:05:37 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CZTnr59Mdz6v92; Mon, 16 Nov 2020 21:05:20 +0800 (CST) Received: from compute.localdomain (10.175.112.70) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 16 Nov 2020 21:05:30 +0800 From: Zhang Changzhong To: , , , , CC: , Subject: [PATCH net] qed: fix error return code in qed_iwarp_ll2_start() Date: Mon, 16 Nov 2020 21:07:13 +0800 Message-ID: <1605532033-27373-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.112.70] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 469981b17a4f ("qed: Add unaligned and packed packet processing") Fixes: fcb39f6c10b2 ("qed: Add mpa buffer descriptors for storing and processing mpa fpdus") Fixes: 1e28eaad07ea ("qed: Add iWARP support for fpdu spanned over more than two tcp packets") Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index 512cbef..a998611 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -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 @@ -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); -- 2.9.5