From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 8FEF74F4D18; Tue, 13 Oct 2026 12:49:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791895762; cv=none; b=SZhyXs+EQRAWjXxOyotOQtj3TCHsOoeCPRsENoKXmlU0AAUnydgLQJFbzRAFskNPT5garVXJqbFo2Tdi6NxGmZ2kv7bYYxzPYXEoFOG13BYhktKqun4LnTeSE5fEL2dE8p5F2nsAxV/wVch8jisaGHLKTXY0aUi6jnaYwKlAV5k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791895762; c=relaxed/simple; bh=qxoM5LvdOBnuGG6x1gDha5wHtOD1e22VmM2xuOOShPI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rW2WyQeinko1CXZhXq94TrPyX7j1misE3meVOh+OETPiQKEi0gIo3liyopJvpUha61H6oLqIsFYpOdi8cuwzTw04tr81QtUfAT+Pvl9lyfoGYDP/A9PDSqHubUiy5dMG2albGpPOZzYKdPNUDKvtw48CjNaSs512G0ZNlhXFqiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2ALr1SkV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2ALr1SkV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E00921F000FF; Tue, 13 Oct 2026 12:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791895761; bh=qvmy8ORR7/40Qm3zPhlaJ1xxqetlEVKHDj4FfILtaMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2ALr1SkVm8LsrEhhVgeHl7qIK//an8kwtyXMpY+Q4p87grYcdZS9G1vgvUGStG31e XgTKgCa18izNA0fmG3O8ibWtOCld1KLPf8ERgHXoAcTNqmDOcjD7+1XkQSVnCZlF3S R5RpfuypJCEiAVQhy15PJTxqC7FnwHGtaA+u9bCY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mingming Cao , Dave Marquardt , Jakub Kicinski Subject: [PATCH 6.12 385/497] ibmveth: h_free logical LAN on open-fail after register Date: Tue, 13 Oct 2026 13:39:12 +0200 Message-ID: <20261013112917.032809491@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112907.864180619@linuxfoundation.org> References: <20261013112907.864180619@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mingming Cao commit af0524bf4ce1a4cbd2946aa81751582951cfcab5 upstream. ibmveth_open() registers the logical LAN, then allocates the RX buffer pools. A pool failure jumps to out_free_buffer_pools without h_free_logical_lan(), so PHYP still owns the buffer-list page when it is unmapped. request_irq() failure already issued the hypercall before taking the same label. Move that h_free to the shared post-register unwind so both paths deregister before the buffer list is unmapped. Fixes: d43732ce021f ("ibmveth: properly unwind on init errors") Cc: stable@vger.kernel.org Signed-off-by: Mingming Cao Reviewed-by: Dave Marquardt Link: https://patch.msgid.link/7a56fbfb9e0674f011f4e310fbd7dfd8e67c30aa.1790357373.git.mmc@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ibm/ibmveth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c @@ -607,10 +607,6 @@ static int ibmveth_open(struct net_devic if (rc != 0) { netdev_err(netdev, "unable to request irq 0x%x, rc %d\n", netdev->irq, rc); - do { - lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); - } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY)); - goto out_free_buffer_pools; } @@ -626,6 +622,9 @@ static int ibmveth_open(struct net_devic return 0; out_free_buffer_pools: + do { + lpar_rc = h_free_logical_lan(adapter->vdev->unit_address); + } while (H_IS_LONG_BUSY(lpar_rc) || (lpar_rc == H_BUSY)); while (--i >= 0) { if (adapter->rx_buff_pool[i].active) ibmveth_free_buffer_pool(adapter,