Skip to content

Commit

Permalink
nfc: port100: handle command failure cleanly
Browse files Browse the repository at this point in the history
If starting the transfer of a command suceeds but the transfer for the reply
fails, it is not enough to initiate killing the transfer for the
command may still be running. You need to wait for the killing to finish
before you can reuse URB and buffer.

Reported-and-tested-by: [email protected]
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
oneukum authored and davem330 committed Nov 21, 2019
1 parent 48a322b commit 5f9f0b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nfc/port100.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ static int port100_send_frame_async(struct port100 *dev, struct sk_buff *out,

rc = port100_submit_urb_for_ack(dev, GFP_KERNEL);
if (rc)
usb_unlink_urb(dev->out_urb);
usb_kill_urb(dev->out_urb);

exit:
mutex_unlock(&dev->out_urb_lock);
Expand Down

0 comments on commit 5f9f0b1

Please sign in to comment.