Skip to content

Commit bac9c0b

Browse files
author
Myron Stowe
committed
ata: pata_macio: Fix PCI region leak
JIRA: https://issues.redhat.com/browse/RHEL-107597 Upstream Status: 3e53787 commit 3e53787 Author: Philipp Stanner <phasta@kernel.org> Date: Tue Jun 10 15:54:14 2025 +0200 ata: pata_macio: Fix PCI region leak pci_request_regions() became a managed devres functions if the PCI device was enabled with pcim_enable_device(), which is the case for pata_macio. The PCI subsystem recently removed this hybrid feature from pci_request_region(). When doing so, pata_macio was forgotten to be ported to use pcim_request_all_regions(). If that function is not used, pata_macio will fail on driver-reload because the PCI regions will remain blocked. Fix the region leak by replacing pci_request_regions() with its managed counterpart, pcim_request_all_regions(). Fixes: 51f6aec ("PCI: Remove hybrid devres nature from request functions") Signed-off-by: Philipp Stanner <phasta@kernel.org> Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20250610135413.35930-2-phasta@kernel.org Signed-off-by: Niklas Cassel <cassel@kernel.org> Signed-off-by: Myron Stowe <mstowe@redhat.com>
1 parent 0c8194f commit bac9c0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ata/pata_macio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static int pata_macio_pci_attach(struct pci_dev *pdev,
12981298
priv->dev = &pdev->dev;
12991299

13001300
/* Get MMIO regions */
1301-
if (pci_request_regions(pdev, "pata-macio")) {
1301+
if (pcim_request_all_regions(pdev, "pata-macio")) {
13021302
dev_err(&pdev->dev,
13031303
"Cannot obtain PCI resources\n");
13041304
return -EBUSY;

0 commit comments

Comments
 (0)