debug_log("Reached %s\n", __func__);
 
+       if (floppy->failed_pc == pc)
+               floppy->failed_pc = NULL;
+
        if (pc->c[0] == GPCMD_READ_10 || pc->c[0] == GPCMD_WRITE_10 ||
            (pc->rq && blk_pc_request(pc->rq)))
                uptodate = 1; /* FIXME */
                        return ide_stopped;
                }
                pc->error = 0;
-               if (floppy->failed_pc == pc)
-                       floppy->failed_pc = NULL;
                /* Command finished - Call the callback function */
                pc->callback(drive);
                return ide_stopped;
 
 
        debug_log(DBG_PROCS, "Enter %s\n", __func__);
 
+       if (tape->failed_pc == pc)
+               tape->failed_pc = NULL;
+
        if (pc->c[0] == REQUEST_SENSE) {
                if (uptodate)
                        idetape_analyze_error(drive, pc->buf);
                        idetape_postpone_request(drive);
                        return ide_stopped;
                }
-               if (tape->failed_pc == pc)
-                       tape->failed_pc = NULL;
                /* Command finished - Call the callback function */
                pc->callback(drive);
                return ide_stopped;
                        return ide_stopped;
                }
                pc->error = 0;
-               if (tape->failed_pc == pc)
-                       tape->failed_pc = NULL;
        } else {
                pc->error = IDETAPE_ERROR_GENERAL;
                tape->failed_pc = NULL;