summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-steelseries.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-18HID: steelseries: Fix signedness bug in ↵Dan Carpenter1-1/+1
steelseries_headset_arctis_1_fetch_battery() The hid_hw_raw_request() function returns negative error codes or the number bytes transferred.  The problem is that when it returns negative error codes and we check if "ret < sizeof(arctis_1_battery_request)", then the negative values are type promoted from int to high unsigned long values and treated as success. This was detected using Smatch: drivers/hid/hid-steelseries.c:393 steelseries_headset_arctis_1_fetch_battery() warn: error code type promoted to positive: 'ret' Fixes: a0c76896c3fb ("HID: steelseries: Add support for Arctis 1 XBox") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-08-14HID: steelseries: arctis_1_battery_request[] should be staticJiri Kosina1-1/+1
arctis_1_battery_request[] is not used outside of this module, and as such should be static. Fixes: a0c76896c3fbdc2 ("HID: steelseries: Add support for Arctis 1 XBox") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-08-14HID: steelseries: Add support for Arctis 1 XBoxBastien Nocera1-15/+296
Add support for the Steelseries Arctis 1 XBox headset. This driver will export the battery information from the headset, as well as the "wireless_status" property. Signed-off-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-04-13HID: steelseries: explicitly include linux/leds.hThomas Weißschuh1-0/+1
Instead of relying on an accidental, transitive inclusion of linux/leds.h use it directly. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20230215-power_supply-leds-hid-v1-1-35b6f1dcee8a@weissschuh.net Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner1-4/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-28HID: use to_hid_device()Geliang Tang1-4/+4
Use to_hid_device() instead of container_of(). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2015-02-27HID: remove 2 unused usb.h includesBenjamin Tissoires1-1/+0
These 2 are left over from the USB dependency cleaning, so there is no need to keep them. [jkosina@suse.cz: fix filename] Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-09-13HID: steelseries: validate output report detailsKees Cook1-0/+5
A HID device could send a malicious output report that would cause the steelseries HID driver to write beyond the output report allocation during initialization, causing a heap overflow: [ 167.981534] usb 1-1: New USB device found, idVendor=1038, idProduct=1410 ... [ 182.050547] BUG kmalloc-256 (Tainted: G W ): Redzone overwritten CVE-2013-2891 Signed-off-by: Kees Cook <keescook@chromium.org> Cc: stable@vger.kernel.org Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-05-03HID: hid-steelseries fix led class build issueSimon Wood1-3/+6
Fixes 'undefined reference' issue when hid-steelseries is built in, but led-class is a module. -- drivers/built-in.o: In function `steelseries_srws1_remove': hid-steelseries.c:(.text+0x3b97a1): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `steelseries_srws1_probe': hid-steelseries.c:(.text+0x3b9c51): undefined reference to `led_classdev_register' hid-steelseries.c:(.text+0x3b9ce5): undefined reference to `led_classdev_register' hid-steelseries.c:(.text+0x3b9d4b): undefined reference to `led_classdev_unregister' -- Patch allows LED control when led-class is built in, or both hid-steelseries _and_ led-class are both modules. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Simon Wood <simon@mungewell.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-04-30Merge branches 'for-3.10/multitouch', 'for-3.10/roccat' and ↵Jiri Kosina1-12/+1
'for-3.10/upstream' into for-linus Conflicts: drivers/hid/Kconfig
2013-03-18HID: steelseries: use module_hid_driver() to simplify the codeWei Yongjun1-12/+1
module_hid_driver() makes the code simpler by eliminating boilerplate code.. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-02-25HID: use hid_hw_request() instead of direct call to usbhidBenjamin Tissoires1-2/+1
This allows the hid drivers to be independent from the transport layer. The patch was constructed by replacing all occurences of usbhid_submit_report() by its hid_hw_request() counterpart. Then, drivers not requiring USB_HID anymore have their USB_HID dependency cleaned in the Kconfig file. Finally, few drivers still depends on USB_HID. Many of them are requiring the io wait callback. They are found in the next patch. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> For the sensor-hub part: Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-31HID: steelseries: fix out of bound array accessJiri Kosina1-1/+2
The last field of the driver_data->leds[] array is used to store the special toggle for setting all leds simultaneously, so we need to allocate appropriate number of led_classdev pointers. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-31HID: steelseries: rename driver to be compliant with other driversJiri Kosina1-0/+392
We usually group drivers on a per-vendor basis, implementing device-specific deviations from the standard in vendor-specific driver. Signed-off-by: Jiri Kosina <jkosina@suse.cz>