Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1329254pxu; Mon, 23 Nov 2020 18:46:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXAnCugDZAbXEEv2g0QRn4lnD4SFt5ix9hyy52cfIkdvFdUPaAdLUvpjN/oKf1zFQ7wkvV X-Received: by 2002:a17:906:28d4:: with SMTP id p20mr2284343ejd.322.1606185992586; Mon, 23 Nov 2020 18:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606185992; cv=none; d=google.com; s=arc-20160816; b=yAgj8lf3FFbUNTVJ7FM9vBCBULY6p76z9xoRt00Dzb6IEnQaz5bBd/3cBUMmSnuvW6 qEdpE1NZrtt/Q5z+/Gng9mtRludVOuWqBh0CdUqCt/USFfCi01c+6+Dnsn34+Motc65/ BSNxyyRYLCp2r6qJShXS8H6fO5e3TsqIO3XiJZb1qMUH/IhcLDgmW/aLguqFubSXYPxR czfnHzEeMTgpWzJxZTii9y3jhS+ojXcijUl+LWMonu+75AS+DyD7zDX9gcooSl8E8I+I 3iB5vJ0Ub1Low9hM+bTsBBlIBALxn/JRnZBWP6vEMMixV+6BRo05K484+WykTepliNtS H1gA== 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=EaFTnW3AukcND9w6xGK9KKoQYGzADkON5gIiuN83NUM=; b=bfBTXZevqwYNjf+61lAPD63xJEEq9H+ChNOYgrd92vq7xvc7gIVH/nOQyKX+oXLTKA /GzaXhl1beqyfv4cBt+SqJqrVqxFkXCJWrYSQca4Xp35aENTsJAXmy0s2D+35wt/POqF 1j++S7hk3XE7VB7Tc2ykhI+XUkQKmqyxgeM9niFgybAASVQ9phwNigSkf2vlmJXOv6zS b73CGvlPq/nv40I8pWQ8pDIZNZFywZ8/QgskMTyreCukVHDXRncJ5kxznrbAxmy1mKMs /JDRQHyvI+azuDFPvlozkgWwnimg5URXXbAUzbxepZI7nnT6pnplqbRxQEumfHf4Kuoq bgiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="UbzVm/lE"; 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 a25si8259532edn.377.2020.11.23.18.46.10; Mon, 23 Nov 2020 18:46:32 -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="UbzVm/lE"; 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 S2389122AbgKWN3K (ORCPT + 99 others); Mon, 23 Nov 2020 08:29:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:40884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730688AbgKWMaG (ORCPT ); Mon, 23 Nov 2020 07:30:06 -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 B15C72076E; Mon, 23 Nov 2020 12:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134606; bh=ypVaa8GIVzheOHMEkSpiqcP2KUC1bK82v7aPamTlqoc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UbzVm/lE1RbbtB7MppSdpv3R7lM1IX7BUsVWWPzEvwwO/SeP1PLoNMarvInTnhVUk ABGCJi7Uiv6igms9gCtAH8fbXWF/pCGHoFumjrLlfvnsvrwHoyEVgUmCBmPXN5UKG/ E4e1vlSkB3vUdFVTEkccoVUqLovC9xcie5t2FM2s= 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 4.19 19/91] qed: fix error return code in qed_iwarp_ll2_start() Date: Mon, 23 Nov 2020 13:21:39 +0100 Message-Id: <20201123121810.240509992@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 @@ -2737,14 +2737,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 @@ -2754,8 +2758,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);