Skip to content

Commit

Permalink
ide: make "paranoia" ->handler check in ide_intr() more strict
Browse files Browse the repository at this point in the history
If ->handler is set while it shouldn't be it indicates deep problems
so BUG_ON()-ning and preventing further damage is much more appropriate
than merely printing an error message.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 6, 2009
1 parent d6251d4 commit 9600dcf
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,9 @@ irqreturn_t ide_intr (int irq, void *dev_id)
* won't allow another of the same (on any CPU) until we return.
*/
if (startstop == ide_stopped) {
if (hwif->handler == NULL) { /* paranoia */
ide_unlock_port(hwif);
plug_device = 1;
} else
printk(KERN_ERR "%s: %s: huh? expected NULL handler "
"on exit\n", __func__, drive->name);
BUG_ON(hwif->handler);
ide_unlock_port(hwif);
plug_device = 1;
}
out_handled:
irq_ret = IRQ_HANDLED;
Expand Down

0 comments on commit 9600dcf

Please sign in to comment.