Skip to content

Commit

Permalink
pata_sis: Fix oops on boot
Browse files Browse the repository at this point in the history
A small number of SiS setups require special handling (not many judging
by how long this dumb bug survived). A couple of Fedora 7 devel testers
hit an Oops on pata_sis loading which is caused by terminal confusion
between chipset as 'the chipset we have found' and chipset as 'array
iterator'

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Apr 19, 2007
1 parent 6f29e35 commit f3769e9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/ata/pata_sis.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
struct ata_port_info *port;
struct pci_dev *host = NULL;
struct sis_chipset *chipset = NULL;
struct sis_chipset *sets;

static struct sis_chipset sis_chipsets[] = {

Expand Down Expand Up @@ -932,10 +933,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)

/* We have to find the bridge first */

for (chipset = &sis_chipsets[0]; chipset->device; chipset++) {
host = pci_get_device(PCI_VENDOR_ID_SI, chipset->device, NULL);
for (sets = &sis_chipsets[0]; sets->device; sets++) {
host = pci_get_device(PCI_VENDOR_ID_SI, sets->device, NULL);
if (host != NULL) {
if (chipset->device == 0x630) { /* SIS630 */
chipset = sets; /* Match found */
if (sets->device == 0x630) { /* SIS630 */
u8 host_rev;
pci_read_config_byte(host, PCI_REVISION_ID, &host_rev);
if (host_rev >= 0x30) /* 630 ET */
Expand All @@ -946,7 +948,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
}

/* Look for concealed bridges */
if (host == NULL) {
if (chipset == NULL) {
/* Second check */
u32 idemisc;
u16 trueid;
Expand Down

0 comments on commit f3769e9

Please sign in to comment.