Skip to content

Commit 537c7ee

Browse files
khayash1vijay-suman
authored andcommitted
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: [email protected] Fixes: e033271 ("pci_endpoint_test: Add 2 ioctl commands") Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Kunihiko Hayashi <[email protected]> Link: https://lore.kernel.org/r/[email protected] [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Kunihiko Hayashi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 54c9f299ad7d7c4be5d271ed12d01a59e95b8907) Signed-off-by: Vijayendra Suman <[email protected]>
1 parent 00d4423 commit 537c7ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/misc/pci_endpoint_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test)
262262
break;
263263
}
264264

265+
test->num_irqs = i;
266+
pci_endpoint_test_release_irq(test);
267+
265268
return false;
266269
}
267270

0 commit comments

Comments
 (0)