hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hid/hid-roccat.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Roccat driver for Linux
34 *
....@@ -5,10 +6,6 @@
56 */
67
78 /*
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the Free
10
- * Software Foundation; either version 2 of the License, or (at your option)
11
- * any later version.
129 */
1310
1411 /*
....@@ -260,6 +257,8 @@
260257 if (!new_value)
261258 return -ENOMEM;
262259
260
+ mutex_lock(&device->cbuf_lock);
261
+
263262 report = &device->cbuf[device->cbuf_end];
264263
265264 /* passing NULL is safe */
....@@ -279,6 +278,8 @@
279278 reader->cbuf_start = (reader->cbuf_start + 1) % ROCCAT_CBUF_SIZE;
280279 }
281280
281
+ mutex_unlock(&device->cbuf_lock);
282
+
282283 wake_up_interruptible(&device->wait);
283284 return 0;
284285 }