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 02072400979; Thu, 16 Jul 2026 13:54:11 +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=1784210053; cv=none; b=dggWK2YJUs7CZ0XLgnEGfYTqZigAv+rszihtiBCmmQ6p4NIipYxsRQx/xolD52FslHldrIfIQXL1d7AJCZHSjizjJs4dytINf35RljyKoQ7v8PxnYN8dE+Mw4gTha9Os1lSckAkpYKbDCu2HWbl0inzViTKBtpo/u8GTFqmu1vY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210053; c=relaxed/simple; bh=Hd8EqmIQ1douS6P29MzynvP4cv9SVjvo+rtxQ+xoIts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tmVLN05Q9oXj/baRLUvMHt6OKS15etffbxc/aThRQHp6QN35KI2joNQxuObM+lyLP+0optGcwIyR2bfA6U153YPqsnsVsRLkmnoMaZCZcFPQV67OyOX0+9+bq7ZR9tQqpHbIS1cCjxk39b1bgNB0QW+1LRXfj3u46xHHXVECWX0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ox/vtL3S; 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="Ox/vtL3S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16ED81F000E9; Thu, 16 Jul 2026 13:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784210051; bh=6mBGabxFysiWgUjl9Lb5WvAUXgsFSnP/G3U8NH04Dn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ox/vtL3SIl5LTU0hmcU03IZnuLJvBAlgnhDX0iP6hvkRukBzMdoa0AIkjeNuxe5FL T8r7IcgFLG+SX/PirOIttsfo4E//RqhfYHgvbTaQJhD/36IuTsiSMoAeFOfYPyL4ps 1j90vBXBgrX9x0vfNc56+xgSTEtQR2F8XUGuEnYI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Koichiro Den , Manivannan Sadhasivam , Bjorn Helgaas , Dave Jiang Subject: [PATCH 7.1 419/518] NTB: epf: Fix request_irq() unwind in ntb_epf_init_isr() Date: Thu, 16 Jul 2026 15:31:27 +0200 Message-ID: <20260716133057.005961314@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133047.772246337@linuxfoundation.org> References: <20260716133047.772246337@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 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Koichiro Den commit fcba26efe5efc7441f5505f4ccc69791214b40be upstream. ntb_epf_init_isr() requests multiple MSI/MSI-X vectors in a loop. If request_irq() fails part-way through, it jumps straight to pci_free_irq_vectors() without freeing already requested IRQs. Fix the error path by freeing any successfully requested IRQs before releasing the vectors. Fixes: 812ce2f8d14e ("NTB: Add support for EPF PCI Non-Transparent Bridge") Signed-off-by: Koichiro Den Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Reviewed-by: Dave Jiang Cc: stable@vger.kernel.org # v5.12+ Link: https://patch.msgid.link/20260304083028.1391068-2-den@valinux.co.jp Signed-off-by: Greg Kroah-Hartman --- drivers/ntb/hw/epf/ntb_hw_epf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/drivers/ntb/hw/epf/ntb_hw_epf.c +++ b/drivers/ntb/hw/epf/ntb_hw_epf.c @@ -357,7 +357,7 @@ static int ntb_epf_init_isr(struct ntb_e 0, "ntb_epf", ndev); if (ret) { dev_err(dev, "Failed to request irq\n"); - goto err_request_irq; + goto err_free_irq; } } @@ -367,16 +367,14 @@ static int ntb_epf_init_isr(struct ntb_e argument | irq); if (ret) { dev_err(dev, "Failed to configure doorbell\n"); - goto err_configure_db; + goto err_free_irq; } return 0; -err_configure_db: - for (i = 0; i < ndev->db_count + 1; i++) +err_free_irq: + while (i--) free_irq(pci_irq_vector(pdev, i), ndev); - -err_request_irq: pci_free_irq_vectors(pdev); return ret;