summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>2025-02-25 20:02:48 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 10:44:00 +0200
commit9d5118b107b1a2353ed0dff24404aee2e6b7ca0a (patch)
tree307ac6d33f7af666d3a88f4c46d68bb83aab8303
parent6cc2c355aa87618a50a1e39dc22a9416fa92cc5f (diff)
downloadlinux-9d5118b107b1a2353ed0dff24404aee2e6b7ca0a.tar.gz
linux-9d5118b107b1a2353ed0dff24404aee2e6b7ca0a.tar.bz2
linux-9d5118b107b1a2353ed0dff24404aee2e6b7ca0a.zip
misc: pci_endpoint_test: Avoid issue of interrupts remaining after request_irq error
commit f6cb7828c8e17520d4f5afb416515d3fae1af9a9 upstream. After devm_request_irq() fails with error in pci_endpoint_test_request_irq(), the pci_endpoint_test_free_irq_vectors() is called assuming that all IRQs have been released. However, some requested IRQs remain unreleased, so there are still /proc/irq/* entries remaining, and this results in WARN() with the following message: remove_proc_entry: removing non-empty directory 'irq/30', leaking at least 'pci-endpoint-test.0' WARNING: CPU: 0 PID: 202 at fs/proc/generic.c:719 remove_proc_entry +0x190/0x19c To solve this issue, set the number of remaining IRQs to test->num_irqs, and release IRQs in advance by calling pci_endpoint_test_release_irq(). Cc: stable@vger.kernel.org Fixes: e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands") Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Link: https://lore.kernel.org/r/20250225110252.28866-3-hayashi.kunihiko@socionext.com [kwilczynski: commit log] Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/pci_endpoint_test.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
index 18059a12d4e1..7906709e7f74 100644
--- a/drivers/misc/pci_endpoint_test.c
+++ b/drivers/misc/pci_endpoint_test.c
@@ -262,6 +262,9 @@ fail:
break;
}
+ test->num_irqs = i;
+ pci_endpoint_test_release_irq(test);
+
return false;
}