From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF28918A924; Mon, 28 Oct 2024 06:45:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730097954; cv=none; b=VliSp9BUO5m0av3Dk6lr1MktZgmDRsBJNlk21bSysHP+B80RAqpADxjW+9q3a+UwGKftFC6WSBZyJNRobnZsRj3LSKpRXOnXGFvxzJ6lhDNU89Y0jtyQ75zbIbuvx1clzqETZREOO9cIC65DUoI6CEGtzOx6GaqTl8fmrZgpIlU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730097954; c=relaxed/simple; bh=itk9mo+oWqyO2luVOC9u7mxP2CCiSYHGt98/NmivB6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HYY/CmBqOh/XLgbuek8pmuTRgktmKwZxSuw9q9tzyO/ThjrS9L4R/yaTim5IVfCvM74354yzbeXs78zfOjlpDRBBxAic+YOa2uj/5H+f+AKCzwNjjAJ8iR82qcPEbOR/58xmxv2Vjm8ECK3Bo9tq3scH1O+WW83YnvJ6DL/R8ho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xqv9jMxw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xqv9jMxw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90313C4CEC3; Mon, 28 Oct 2024 06:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730097953; bh=itk9mo+oWqyO2luVOC9u7mxP2CCiSYHGt98/NmivB6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqv9jMxwr7JA+rYSIn1Cf233uym36iFSVMjCEqfqbA5D0gF3VsHwa1pw5cTUvdR2K s6L5ZazYFLoXNouxyVzVoPkPs0D0Gk5gaaBkkfp34c9r6Fe5Z4tRDYp34Q+gUW553v vgYS789ptFhD3kC8FwLrzrg6DT/KlI4J9h2TRevg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky , Sasha Levin Subject: [PATCH 6.11 013/261] RDMA/bnxt_re: Add a check for memory allocation Date: Mon, 28 Oct 2024 07:22:35 +0100 Message-ID: <20241028062312.340814483@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062312.001273460@linuxfoundation.org> References: <20241028062312.001273460@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kalesh AP [ Upstream commit c5c1ae73b7741fa3b58e6e001b407825bb971225 ] __alloc_pbl() can return error when memory allocation fails. Driver is not checking the status on one of the instances. Fixes: 0c4dcd602817 ("RDMA/bnxt_re: Refactor hardware queue memory allocation") Link: https://patch.msgid.link/r/1726715161-18941-4-git-send-email-selvin.xavier@broadcom.com Reviewed-by: Selvin Xavier Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/bnxt_re/qplib_res.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index dfc943fab87b4..1fdffd6a0f480 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -244,6 +244,8 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq, sginfo.pgsize = npde * pg_size; sginfo.npages = 1; rc = __alloc_pbl(res, &hwq->pbl[PBL_LVL_0], &sginfo); + if (rc) + goto fail; /* Alloc PBL pages */ sginfo.npages = npbl; -- 2.43.0