Skip to content

Commit 3e53787

Browse files
Philipp Stannerfloatious
authored andcommitted
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 <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
1 parent fe5b391 commit 3e53787

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)