Skip to content

Commit

Permalink
ide: fix buggy code in ide_register_hw()
Browse files Browse the repository at this point in the history
Relocating the index to come after finding the hwif pointer.

Signed-off-by: Peter Teoh <htmldeveloper@gmail.com>
Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Peter Teoh authored and Bartlomiej Zolnierkiewicz committed Mar 7, 2008
1 parent ef4298d commit 0c6025d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,14 @@ int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),

do {
hwif = ide_deprecated_find_port(hw->io_ports[IDE_DATA_OFFSET]);
index = hwif->index;
if (hwif)
goto found;
for (index = 0; index < MAX_HWIFS; index++)
ide_unregister(index, 1, 1);
} while (retry--);
return -1;
found:
index = hwif->index;
if (hwif->present)
ide_unregister(index, 0, 1);
else if (!hwif->hold)
Expand Down

0 comments on commit 0c6025d

Please sign in to comment.