Skip to content

Commit

Permalink
pata_ali: misplaced pci_dev_put()
Browse files Browse the repository at this point in the history
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: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Ben Dooks authored and Jeff Garzik committed Jul 31, 2008
1 parent 660fc1f commit e8389f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/ata/pata_ali.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if ((tmp & 0x1E) == 0x12)
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);
}

Expand Down

0 comments on commit e8389f0

Please sign in to comment.