From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 43276253322; Tue, 29 Apr 2025 17:17:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745947036; cv=none; b=Kg0vfIPmsVVfK4z66DWmHWuJJY4ZN00wb2VEFk67j8qg0Y7alSooan/rp0MYLJKEAu0bxAxqaoqXIWJeqGpSq3Gfzo2u2Gxrjm5TBr47fQ5bq/hoEfQYeTyu/6Z1+/RMA4vCJY0S4loMmXeRwBcdfs/k3kAhdUSUc7UPuSrZk1s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745947036; c=relaxed/simple; bh=sX578whMLxgK10kVG7LmyTiw+2F2/C6R3fMvzO3t76g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N8xitE7p624FRAqmxpDA/1DE7ARCZlIftQinje4JGgHM7G3QKW6FHhIjVV5bKHoYIXpv6tWFbe6cHBtOIIqNb/lhVQeLKunB5/XVs8hrW3U4WU0KGdf94V0XBnSfQciS/Baja+FM4+8rpHsodlMrGQM3Ycnqm7sswL0iWrKPYZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kJRlIuoC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="kJRlIuoC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C90F3C4CEE9; Tue, 29 Apr 2025 17:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1745947036; bh=sX578whMLxgK10kVG7LmyTiw+2F2/C6R3fMvzO3t76g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJRlIuoC6yRlwZdWXd45PRAoIivbQpZ/PocxANXDCUPmVJJVdV+IfGBuroSVLbRAo EPVpJ1BhjHvXWpNY3cdFx66ejICCsldVgRszSYE9Ya8cGUtMM7r9amErB8Y+DWEOZd f242iDcLEy3zxEhMBWAl0zsEtwZ0f89b3XAMCd8c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Manivannan Sadhasivam , Kunihiko Hayashi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Subject: [PATCH 5.10 150/286] misc: pci_endpoint_test: Avoid issue of interrupts remaining after request_irq error Date: Tue, 29 Apr 2025 18:40:54 +0200 Message-ID: <20250429161114.054340441@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250429161107.848008295@linuxfoundation.org> References: <20250429161107.848008295@linuxfoundation.org> User-Agent: quilt/0.68 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kunihiko Hayashi 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 Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/20250225110252.28866-3-hayashi.kunihiko@socionext.com [kwilczynski: commit log] Signed-off-by: Krzysztof WilczyƄski Signed-off-by: Kunihiko Hayashi Signed-off-by: Greg Kroah-Hartman --- drivers/misc/pci_endpoint_test.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -263,6 +263,9 @@ fail: break; } + test->num_irqs = i; + pci_endpoint_test_release_irq(test); + return false; }