forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/usb/usbip/stub_rx.c
....@@ -18,9 +18,9 @@
1818
1919 req = (struct usb_ctrlrequest *) urb->setup_packet;
2020
21
- return (req->bRequest == USB_REQ_CLEAR_FEATURE) &&
22
- (req->bRequestType == USB_RECIP_ENDPOINT) &&
23
- (req->wValue == USB_ENDPOINT_HALT);
21
+ return (req->bRequest == USB_REQ_CLEAR_FEATURE) &&
22
+ (req->bRequestType == USB_RECIP_ENDPOINT) &&
23
+ (req->wValue == USB_ENDPOINT_HALT);
2424 }
2525
2626 static int is_set_interface_cmd(struct urb *urb)
....@@ -138,7 +138,9 @@
138138 req = (struct usb_ctrlrequest *) urb->setup_packet;
139139 config = le16_to_cpu(req->wValue);
140140
141
+ usb_lock_device(sdev->udev);
141142 err = usb_set_configuration(sdev->udev, config);
143
+ usb_unlock_device(sdev->udev);
142144 if (err && err != -ENODEV)
143145 dev_err(&sdev->udev->dev, "can't set config #%d, error %d\n",
144146 config, err);
....@@ -424,7 +426,7 @@
424426 case USB_ENDPOINT_XFER_BULK:
425427 if (is_out)
426428 allowed |= URB_ZERO_PACKET;
427
- /* FALLTHROUGH */
429
+ fallthrough;
428430 default: /* all non-iso endpoints */
429431 if (!is_out)
430432 allowed |= URB_SHORT_NOT_OK;