Skip to content

Commit 5c5d8eb

Browse files
sgruszkagregkh
authored andcommitted
usb: misc: ljca: move usb_autopm_put_interface() after wait for response
Do not mark interface as ready to suspend when we are still waiting for response messages from the device. Fixes: acd6199 ("usb: Add support for Intel LJCA device") Cc: [email protected] Reviewed-by: Hans de Goede <[email protected]> Tested-by: Hans de Goede <[email protected]> # ThinkPad X1 Yoga Gen 8, ov2740 Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1d062ff commit 5c5d8eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/usb/misc/usb-ljca.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,26 +332,26 @@ static int ljca_send(struct ljca_adapter *adap, u8 type, u8 cmd,
332332

333333
ret = usb_bulk_msg(adap->usb_dev, adap->tx_pipe, header,
334334
msg_len, &transferred, LJCA_WRITE_TIMEOUT_MS);
335-
336-
usb_autopm_put_interface(adap->intf);
337-
338335
if (ret < 0)
339-
goto out;
336+
goto out_put;
340337
if (transferred != msg_len) {
341338
ret = -EIO;
342-
goto out;
339+
goto out_put;
343340
}
344341

345342
if (ack) {
346343
ret = wait_for_completion_timeout(&adap->cmd_completion,
347344
timeout);
348345
if (!ret) {
349346
ret = -ETIMEDOUT;
350-
goto out;
347+
goto out_put;
351348
}
352349
}
353350
ret = adap->actual_length;
354351

352+
out_put:
353+
usb_autopm_put_interface(adap->intf);
354+
355355
out:
356356
spin_lock_irqsave(&adap->lock, flags);
357357
adap->ex_buf = NULL;

0 commit comments

Comments
 (0)