hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/sound/usb/line6/midi.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Line 6 Linux USB driver
34 *
45 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation, version 2.
9
- *
106 */
117
128 #include <linux/slab.h>
....@@ -48,7 +44,8 @@
4844 int req, done;
4945
5046 for (;;) {
51
- req = min(line6_midibuf_bytes_free(mb), line6->max_packet_size);
47
+ req = min3(line6_midibuf_bytes_free(mb), line6->max_packet_size,
48
+ LINE6_FALLBACK_MAXPACKETSIZE);
5249 done = snd_rawmidi_transmit_peek(substream, chunk, req);
5350
5451 if (done == 0)
....@@ -60,7 +57,8 @@
6057
6158 for (;;) {
6259 done = line6_midibuf_read(mb, chunk,
63
- LINE6_FALLBACK_MAXPACKETSIZE);
60
+ LINE6_FALLBACK_MAXPACKETSIZE,
61
+ LINE6_MIDIBUF_READ_TX);
6462
6563 if (done == 0)
6664 break;