diff options
-rw-r--r-- | drivers/block/ub.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index db4943c53d36..c3600cb36365 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -1106,7 +1106,8 @@ static void ub_urb_timeout(unsigned long arg) | |||
1106 | unsigned long flags; | 1106 | unsigned long flags; |
1107 | 1107 | ||
1108 | spin_lock_irqsave(sc->lock, flags); | 1108 | spin_lock_irqsave(sc->lock, flags); |
1109 | usb_unlink_urb(&sc->work_urb); | 1109 | if (!ub_is_completed(&sc->work_done)) |
1110 | usb_unlink_urb(&sc->work_urb); | ||
1110 | spin_unlock_irqrestore(sc->lock, flags); | 1111 | spin_unlock_irqrestore(sc->lock, flags); |
1111 | } | 1112 | } |
1112 | 1113 | ||
@@ -1131,7 +1132,6 @@ static void ub_scsi_action(unsigned long _dev) | |||
1131 | unsigned long flags; | 1132 | unsigned long flags; |
1132 | 1133 | ||
1133 | spin_lock_irqsave(sc->lock, flags); | 1134 | spin_lock_irqsave(sc->lock, flags); |
1134 | del_timer(&sc->work_timer); | ||
1135 | ub_scsi_dispatch(sc); | 1135 | ub_scsi_dispatch(sc); |
1136 | spin_unlock_irqrestore(sc->lock, flags); | 1136 | spin_unlock_irqrestore(sc->lock, flags); |
1137 | } | 1137 | } |
@@ -1155,6 +1155,7 @@ static void ub_scsi_dispatch(struct ub_dev *sc) | |||
1155 | } else { | 1155 | } else { |
1156 | if (!ub_is_completed(&sc->work_done)) | 1156 | if (!ub_is_completed(&sc->work_done)) |
1157 | break; | 1157 | break; |
1158 | del_timer(&sc->work_timer); | ||
1158 | ub_scsi_urb_compl(sc, cmd); | 1159 | ub_scsi_urb_compl(sc, cmd); |
1159 | } | 1160 | } |
1160 | } | 1161 | } |