ide-tape: remove back-to-back REQUEST_SENSE detection
authorTejun Heo <tj@kernel.org>
Sat, 18 Apr 2009 22:00:41 +0000 (07:00 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:16 +0000 (09:40 -0700)
commit 36999a5af1b6c5379e59f0ddf434db08d03c19e4 upstream.

Impact: fix an oops which always triggers

ide_tape_issue_pc() assumed drive->pc isn't NULL on invocation when
checking for back-to-back request sense issues but drive->pc can be
NULL and even when it's not NULL, it's not safe to dereference it once
the previous command is complete because pc could have been freed or
was on stack.  Kill back-to-back REQUEST_SENSE detection.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/ide/ide-tape.c

index 4e6181c7bbdaf613e18a6fdd461cdfdef60afa83..af7860cb7f7c5a1068bf0c77c77f1d17cdbd8bdb 100644 (file)
@@ -654,12 +654,6 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
 {
        idetape_tape_t *tape = drive->driver_data;
 
-       if (drive->pc->c[0] == REQUEST_SENSE &&
-           pc->c[0] == REQUEST_SENSE) {
-               printk(KERN_ERR "ide-tape: possible ide-tape.c bug - "
-                       "Two request sense in serial were issued\n");
-       }
-
        if (tape->failed_pc == NULL && pc->c[0] != REQUEST_SENSE)
                tape->failed_pc = pc;