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 6408B348C4A; Tue, 21 Jul 2026 22:02:46 +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=1784671367; cv=none; b=VUJrPrEo+MrMwW1w5Yv3UdjLBbyB+COyiA7jDVZVRZbwyZx1IlH+5S9aggZN1zUoT+b3w9DlKa4nhDXQnDap7uxmkQkSuCDTssUGXltNvSoG/ayIqwpzBLpJuvdUcFwVC9IGrHdEuwFo5D8Go01sDU58TEMmW3hslMgB7sOsZkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784671367; c=relaxed/simple; bh=+dyD87338rC7ALU5hBTSGZwx+0twnuM5KBsg0sE8Yeo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZKagSc3/hyjAxrzjh5emoPJbiMiMEDEYKF29JAi4iNhGQpfdTqS/KO+XAYHFw5V1+Z/naf4WZnwO9oDd17IB+dUTdhvHgjlIA0kX/1e990N09xdI/LpsXA2jJoZkmAEM011v0Fnf/WEj/UnQHAetRaqOM0MJ0Z+KG8Eb/4pkass= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hJ6TTtXw; 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="hJ6TTtXw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAC6D1F000E9; Tue, 21 Jul 2026 22:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784671366; bh=v5VxKh5a/5b1BQBX1Vm5rin16amMoHZj4Zksi727xtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hJ6TTtXwEui+5tSaox0XdM7q5nrhrLEMo9br3WrELMmYODpn2eeP0C5oMAw+Uan+F CWzuKsqeqnrjg//UzsyYoeWAEibaYKjjB1CBMJgyhcBBQdL6NsG9PKHOWMLFXw6qOk NyAHTnpUJNa8GMfBbN42vrIh9sZyh4PmjgLzGPxI= 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 5.15 176/843] NTB: epf: Fix request_irq() unwind in ntb_epf_init_isr() Date: Tue, 21 Jul 2026 17:16:51 +0200 Message-ID: <20260721152409.976339345@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@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 5.15-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 @@ -355,7 +355,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; } } @@ -365,16 +365,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;