Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238436pxu; Mon, 23 Nov 2020 15:36:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXVrMMSgdslYMUxykHzs1AJP3Ax4Chl4+sZNKSwi3Y7hr/Gmnq+PkMAu+VRR/60YUNGlkE X-Received: by 2002:a50:ab07:: with SMTP id s7mr1456984edc.287.1606174610137; Mon, 23 Nov 2020 15:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174610; cv=none; d=google.com; s=arc-20160816; b=fJM5OEJDNhNSPkHwYLJGcytC2+nUmopCTN3tJpa6szRS/B5RWGO8CdjIJRfhAaTozm wouJfiVf/BkTB/dNdlPOXGpBW8sxh47JJP3FiWRkRHx3T1s+BpAByliU8HuODMnUBmbN fY0gx8KzRLJ4Z2cOi4rmvX8LJa8B5wISxf3DbtVeJRscZljW1zsi9rQ+PWCMEKe3Wfd3 WY1qY6kw8uCYMGWtGfh0/CllVgOUrujIzgmapek7a/Q5WJPXXMbaQF5c4UoCZgP6n9f9 5vcWrkBonVae8n1c/xOcjAScBfQq2CnN2CWKH9pFW/R7W98n3821TScnPYnO7TsYupSq cXFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Hytisx9y16zM+OyPr59tGAYDoRrki8cO8oBFw/HGdZg=; b=qWgymvXbJmHulCqle84N+KzVvCafPU5FAc1DUJt7cF2sJ8YIwV7Ug6KcW/gPnQdilB kjmSTm7pk4au5gWvd2o12FeVDqA+2jcgjBTGCdRafEcKurIpPlQzPtk6WCxENYXx17Py pNTiRi+3VS5jcHHROMwEPMPUbSlxqW/MPJmXfmfXay/pL7+ex9ORo5nKGMIIpW9ommV8 YYu9SIRYjQoEQ8vFdlwJHUBec6pDUEcWNm0PqD7YvigRTxX2K2fUs1f9FpHdg2SHJLug lk9d5vOCS6HZKtxWLfa3fX9vbVmV2teZGrgX6f1WJlk8CXg9f2oPzN7r2haNMZY548xs P7Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a44QMAST; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv19si7317934ejb.459.2020.11.23.15.36.27; Mon, 23 Nov 2020 15:36:50 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a44QMAST; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730864AbgKWMg1 (ORCPT + 99 others); Mon, 23 Nov 2020 07:36:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:48014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731632AbgKWMgF (ORCPT ); Mon, 23 Nov 2020 07:36:05 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 863A22065E; Mon, 23 Nov 2020 12:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134965; bh=SQEwHf3JHZSKznBe9IeJQOSiOB0cMsDK0N1wUX1gEqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a44QMAST3xJbe0Rx+uF2LPeDqbFe3kSq3gFISATnRUefNe/3EMIlKdtPuBNqoT6vE 9CPrdtgOM2xxJFo+mDPv7Ed71xebZn4jePaCSw//mfZku41Tw2VuJGO4FCp+9DwdBp Sm0mNX7QvMgsZ4RHWS/kXIKZ1wIBHy0Hh6XnJ4cc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Changzhong , =?UTF-8?q?Michal=20Kalderon=C2=A0?= , Jakub Kicinski Subject: [PATCH 5.4 025/158] qed: fix error return code in qed_iwarp_ll2_start() Date: Mon, 23 Nov 2020 13:20:53 +0100 Message-Id: <20201123121821.149010744@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Changzhong [ Upstream commit cb47d16ea21045c66eebbf5ed792e74a8537e27a ] 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 Acked-by: Michal KalderonĀ  Link: https://lore.kernel.org/r/1605532033-27373-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -2742,14 +2742,18 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_h 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 @@ -2759,8 +2763,10 @@ qed_iwarp_ll2_start(struct qed_hwfn *p_h 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);