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 33DD318E348; Mon, 28 Oct 2024 06:38:36 +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=1730097517; cv=none; b=XT8Y9yKAhkPpw5UZm/RH5pJzcEvrPWAxD38Ir34hUx/Ievi1pXFQlxjzPkJKRA0hR0d8dEbaWYBZhLYKte7I/iQqZQavpBZ/ejxuOmJROIFlGcOySraegcEdZoSHnBWb5VJi7Th+2uT3wOOY9DJuOgUYxmTjjYcsx/4CTge/NI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730097517; c=relaxed/simple; bh=05/oJvxDdTeZaVwyWHp/DyoDlH3cgObtWZkudRlW4iY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jAE2mjgfNVul9ovmuLJgOPglpNF14ijoSfEgh4YXRbYaEK66gLn1zRFsMRC6SgxSnu7wYNrW2sUtv5TBsZxQxeaK61Thtu0+sxU7HKADVXdwSnSBtoTaTDB9pFZgi2E6OYiy5ZHY6EgOcjpXKi6kS+ZST5hmG0xHYFHJ88imHuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=F68LeRA6; 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="F68LeRA6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80903C4CEC3; Mon, 28 Oct 2024 06:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730097516; bh=05/oJvxDdTeZaVwyWHp/DyoDlH3cgObtWZkudRlW4iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F68LeRA6qrndBuAyk8tQfaBTHo9izCJvcrhUjjzvNrOXfK6Rq2b+YVBiLUSX5Gfv6 A6Qg9h7fbnZ962wgZmKQi66/gdvXfYtHqoriFFg4TmW4GTcC96gpml+JItQHEnU0og +ytWK+zABIxzMDQUIAx+ih1n2q2zep94IwDYfg1I= 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.6 009/208] RDMA/bnxt_re: Add a check for memory allocation Date: Mon, 28 Oct 2024 07:23:09 +0100 Message-ID: <20241028062306.887444446@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241028062306.649733554@linuxfoundation.org> References: <20241028062306.649733554@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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 ae2bde34e785b..47406ab8879c1 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