| .. | .. |
|---|
| 646 | 646 | pr_err_ratelimited("error submitting urb(%d)\n", retval); |
|---|
| 647 | 647 | } else { |
|---|
| 648 | 648 | /* Wait for transmission to complete (or abort) */ |
|---|
| 649 | | - mutex_unlock(&ictx->lock); |
|---|
| 650 | 649 | retval = wait_for_completion_interruptible( |
|---|
| 651 | 650 | &ictx->tx.finished); |
|---|
| 652 | 651 | if (retval) { |
|---|
| 653 | 652 | usb_kill_urb(ictx->tx_urb); |
|---|
| 654 | 653 | pr_err_ratelimited("task interrupted\n"); |
|---|
| 655 | 654 | } |
|---|
| 656 | | - mutex_lock(&ictx->lock); |
|---|
| 657 | 655 | |
|---|
| 656 | + ictx->tx.busy = false; |
|---|
| 658 | 657 | retval = ictx->tx.status; |
|---|
| 659 | 658 | if (retval) |
|---|
| 660 | 659 | pr_err_ratelimited("packet tx failed (%d)\n", retval); |
|---|
| .. | .. |
|---|
| 958 | 957 | if (ictx->disconnected) |
|---|
| 959 | 958 | return -ENODEV; |
|---|
| 960 | 959 | |
|---|
| 961 | | - mutex_lock(&ictx->lock); |
|---|
| 960 | + if (mutex_lock_interruptible(&ictx->lock)) |
|---|
| 961 | + return -ERESTARTSYS; |
|---|
| 962 | 962 | |
|---|
| 963 | 963 | if (!ictx->dev_present_intf0) { |
|---|
| 964 | 964 | pr_err_ratelimited("no iMON device present\n"); |
|---|