Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8389f0c authored by Ben Dooks's avatar Ben Dooks Committed by Jeff Garzik
Browse files

pata_ali: misplaced pci_dev_put()



The ali_init_one() function does a search for an isa_bridge,
but then fails to release it if the revision information was
not correctly found.

the problem comes from:
	isa_bridge = pci_get_device(...);
	if (isa_bridge && ...) {
		pci_dev_put(isa_bridge);
	}

where the pci_dev_put() is never called if isa_bridge
was valid but the extra checks on the chip-revision
fail to match.

Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 660fc1f4
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -550,8 +550,9 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
		pci_read_config_byte(isa_bridge, 0x5E, &tmp);
		pci_read_config_byte(isa_bridge, 0x5E, &tmp);
		if ((tmp & 0x1E) == 0x12)
		if ((tmp & 0x1E) == 0x12)
	        	ppi[0] = &info_20_udma;
	        	ppi[0] = &info_20_udma;
		pci_dev_put(isa_bridge);
	}
	}
	pci_dev_put(isa_bridge);

	return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL);
	return ata_pci_sff_init_one(pdev, ppi, &ali_sht, NULL);
}
}