hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/usb/usb-skeleton.c
....@@ -35,9 +35,11 @@
3535
3636 /* our private defines. if this grows any larger, use your own .h file */
3737 #define MAX_TRANSFER (PAGE_SIZE - 512)
38
-/* MAX_TRANSFER is chosen so that the VM is not stressed by
39
- allocations > PAGE_SIZE and the number of packets in a page
40
- is an integer 512 is the largest possible packet on EHCI */
38
+/*
39
+ * MAX_TRANSFER is chosen so that the VM is not stressed by
40
+ * allocations > PAGE_SIZE and the number of packets in a page
41
+ * is an integer 512 is the largest possible packet on EHCI
42
+ */
4143 #define WRITES_IN_FLIGHT 8
4244 /* arbitrarily chosen */
4345
....@@ -228,8 +230,7 @@
228230
229231 dev = file->private_data;
230232
231
- /* if we cannot read at all, return EOF */
232
- if (!dev->bulk_in_urb || !count)
233
+ if (!count)
233234 return 0;
234235
235236 /* no concurrent readers */
....@@ -573,6 +574,7 @@
573574 dev->disconnected = 1;
574575 mutex_unlock(&dev->io_mutex);
575576
577
+ usb_kill_urb(dev->bulk_in_urb);
576578 usb_kill_anchored_urbs(&dev->submitted);
577579
578580 /* decrement our usage count */