<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/hid/wacom_sys.c, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-07-06T09:01:44+00:00</updated>
<entry>
<title>HID: wacom: fix kobject reference count leak</title>
<updated>2025-07-06T09:01:44+00:00</updated>
<author>
<name>Qasim Ijaz</name>
<email>qasdev00@gmail.com</email>
</author>
<published>2025-06-06T18:49:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=70017f56b12077f7f066395390c349af8b8d9fbb'/>
<id>urn:sha1:70017f56b12077f7f066395390c349af8b8d9fbb</id>
<content type='text'>
commit 85a720f4337f0ddf1603c8b75a8f1ffbbe022ef9 upstream.

When sysfs_create_files() fails in wacom_initialize_remotes() the error
is returned and the cleanup action will not have been registered yet.

As a result the kobject???s refcount is never dropped, so the
kobject can never be freed leading to a reference leak.

Fix this by calling kobject_put() before returning.

Fixes: 83e6b40e2de6 ("HID: wacom: EKR: have the wacom resources dynamically allocated")
Acked-by: Ping Cheng &lt;ping.cheng@wacom.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz &lt;qasdev00@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: fix memory leak on sysfs attribute creation failure</title>
<updated>2025-07-06T09:01:44+00:00</updated>
<author>
<name>Qasim Ijaz</name>
<email>qasdev00@gmail.com</email>
</author>
<published>2025-06-06T18:49:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2746d020667ef384765004c74c9f22a589a1682e'/>
<id>urn:sha1:2746d020667ef384765004c74c9f22a589a1682e</id>
<content type='text'>
commit 1a19ae437ca5d5c7d9ec2678946fb339b1c706bf upstream.

When sysfs_create_files() fails during wacom_initialize_remotes() the
fifo buffer is not freed leading to a memory leak.

Fix this by calling kfifo_free() before returning.

Fixes: 83e6b40e2de6 ("HID: wacom: EKR: have the wacom resources dynamically allocated")
Reviewed-by: Ping Cheng &lt;ping.cheng@wacom.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz &lt;qasdev00@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: fix memory leak on kobject creation failure</title>
<updated>2025-07-06T09:01:44+00:00</updated>
<author>
<name>Qasim Ijaz</name>
<email>qasdev00@gmail.com</email>
</author>
<published>2025-06-06T18:49:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a85999b9876543aa9b7a204ee2a660e1d1806262'/>
<id>urn:sha1:a85999b9876543aa9b7a204ee2a660e1d1806262</id>
<content type='text'>
commit 5ae416c5b1e2e816aee7b3fc8347adf70afabb4c upstream.

During wacom_initialize_remotes() a fifo buffer is allocated
with kfifo_alloc() and later a cleanup action is registered
during devm_add_action_or_reset() to clean it up.

However if the code fails to create a kobject and register it
with sysfs the code simply returns -ENOMEM before the cleanup
action is registered leading to a memory leak.

Fix this by ensuring the fifo is freed when the kobject creation
and registration process fails.

Fixes: 83e6b40e2de6 ("HID: wacom: EKR: have the wacom resources dynamically allocated")
Reviewed-by: Ping Cheng &lt;ping.cheng@wacom.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz &lt;qasdev00@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: fix crash in wacom_aes_battery_handler()</title>
<updated>2025-07-06T09:01:39+00:00</updated>
<author>
<name>Thomas Zeitlhofer</name>
<email>thomas.zeitlhofer+lkml@ze-it.at</email>
</author>
<published>2025-05-19T08:54:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a4f182ffa30c52ad1c8e12edfb8049ee748c0f1b'/>
<id>urn:sha1:a4f182ffa30c52ad1c8e12edfb8049ee748c0f1b</id>
<content type='text'>
[ Upstream commit f3054152c12e2eed1e72704aff47b0ea58229584 ]

Commit fd2a9b29dc9c ("HID: wacom: Remove AES power_supply after extended
inactivity") introduced wacom_aes_battery_handler() which is scheduled
as a delayed work (aes_battery_work).

In wacom_remove(), aes_battery_work is not canceled. Consequently, if
the device is removed while aes_battery_work is still pending, then hard
crashes or "Oops: general protection fault..." are experienced when
wacom_aes_battery_handler() is finally called. E.g., this happens with
built-in USB devices after resume from hibernate when aes_battery_work
was still pending at the time of hibernation.

So, take care to cancel aes_battery_work in wacom_remove().

Fixes: fd2a9b29dc9c ("HID: wacom: Remove AES power_supply after extended inactivity")
Signed-off-by: Thomas Zeitlhofer &lt;thomas.zeitlhofer+lkml@ze-it.at&gt;
Acked-by: Ping Cheng &lt;ping.cheng@wacom.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: Initialize brightness of LED trigger</title>
<updated>2025-02-01T17:39:39+00:00</updated>
<author>
<name>Jason Gerecke</name>
<email>jason.gerecke@wacom.com</email>
</author>
<published>2024-12-09T18:40:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f5e6cbc4f5e5888c4b5ef22c9d5adc361fcc66f'/>
<id>urn:sha1:5f5e6cbc4f5e5888c4b5ef22c9d5adc361fcc66f</id>
<content type='text'>
commit 88006b8eca63467cf1b28fed839f4954c578eeff upstream.

If an LED has a default_trigger set prior to being registered with
the subsystem, that trigger will be executed with a brightness value
defined by `trigger-&gt;brightness`. Our driver was not setting this
value, which was causing problems. It would cause the selected LED
to be turned off, as well as corrupt the hlv/llv values assigned to
other LEDs (since calling `wacom_led_brightness_set` will overite
these values).

This patch sets the value of `trigger-&gt;brightness` to an appropriate
value. We use `wacom_leds_brightness_get` to transform the llv/hlv
values into a brightness that is understood by the rest of the LED
subsystem.

Fixes: 822c91e72eac ("leds: trigger: Store brightness set by led_trigger_event()")
Cc: stable@vger.kernel.org # v6.10+
Signed-off-by: Jason Gerecke &lt;jason.gerecke@wacom.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: fix when get product name maybe null pointer</title>
<updated>2024-12-14T19:03:20+00:00</updated>
<author>
<name>WangYuli</name>
<email>wangyuli@uniontech.com</email>
</author>
<published>2024-11-25T05:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e689bc6697a7fcebd4a945ab0b1e1112c76024d8'/>
<id>urn:sha1:e689bc6697a7fcebd4a945ab0b1e1112c76024d8</id>
<content type='text'>
commit 59548215b76be98cf3422eea9a67d6ea578aca3d upstream.

Due to incorrect dev-&gt;product reporting by certain devices, null
pointer dereferences occur when dev-&gt;product is empty, leading to
potential system crashes.

This issue was found on EXCELSIOR DL37-D05 device with
Loongson-LS3A6000-7A2000-DL37 motherboard.

Kernel logs:
[   56.470885] usb 4-3: new full-speed USB device number 4 using ohci-pci
[   56.671638] usb 4-3: string descriptor 0 read error: -22
[   56.671644] usb 4-3: New USB device found, idVendor=056a, idProduct=0374, bcdDevice= 1.07
[   56.671647] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   56.678839] hid-generic 0003:056A:0374.0004: hiddev0,hidraw3: USB HID v1.10 Device [HID 056a:0374] on usb-0000:00:05.0-3/input0
[   56.697719] CPU 2 Unable to handle kernel paging request at virtual address 0000000000000000, era == 90000000066e35c8, ra == ffff800004f98a80
[   56.697732] Oops[#1]:
[   56.697734] CPU: 2 PID: 2742 Comm: (udev-worker) Tainted: G           OE      6.6.0-loong64-desktop #25.00.2000.015
[   56.697737] Hardware name: Inspur CE520L2/C09901N000000000, BIOS 2.09.00 10/11/2024
[   56.697739] pc 90000000066e35c8 ra ffff800004f98a80 tp 9000000125478000 sp 900000012547b8a0
[   56.697741] a0 0000000000000000 a1 ffff800004818b28 a2 0000000000000000 a3 0000000000000000
[   56.697743] a4 900000012547b8f0 a5 0000000000000000 a6 0000000000000000 a7 0000000000000000
[   56.697745] t0 ffff800004818b2d t1 0000000000000000 t2 0000000000000003 t3 0000000000000005
[   56.697747] t4 0000000000000000 t5 0000000000000000 t6 0000000000000000 t7 0000000000000000
[   56.697748] t8 0000000000000000 u0 0000000000000000 s9 0000000000000000 s0 900000011aa48028
[   56.697750] s1 0000000000000000 s2 0000000000000000 s3 ffff800004818e80 s4 ffff800004810000
[   56.697751] s5 90000001000b98d0 s6 ffff800004811f88 s7 ffff800005470440 s8 0000000000000000
[   56.697753]    ra: ffff800004f98a80 wacom_update_name+0xe0/0x300 [wacom]
[   56.697802]   ERA: 90000000066e35c8 strstr+0x28/0x120
[   56.697806]  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
[   56.697816]  PRMD: 0000000c (PPLV0 +PIE +PWE)
[   56.697821]  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
[   56.697827]  ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7)
[   56.697831] ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
[   56.697835]  BADV: 0000000000000000
[   56.697836]  PRID: 0014d000 (Loongson-64bit, Loongson-3A6000)
[   56.697838] Modules linked in: wacom(+) bnep bluetooth rfkill qrtr nls_iso8859_1 nls_cp437 snd_hda_codec_conexant snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore input_leds mousedev led_class joydev deepin_netmonitor(OE) fuse nfnetlink dmi_sysfs ip_tables x_tables overlay amdgpu amdxcp drm_exec gpu_sched drm_buddy radeon drm_suballoc_helper i2c_algo_bit drm_ttm_helper r8169 ttm drm_display_helper spi_loongson_pci xhci_pci cec xhci_pci_renesas spi_loongson_core hid_generic realtek gpio_loongson_64bit
[   56.697887] Process (udev-worker) (pid: 2742, threadinfo=00000000aee0d8b4, task=00000000a9eff1f3)
[   56.697890] Stack : 0000000000000000 ffff800004817e00 0000000000000000 0000251c00000000
[   56.697896]         0000000000000000 00000011fffffffd 0000000000000000 0000000000000000
[   56.697901]         0000000000000000 1b67a968695184b9 0000000000000000 90000001000b98d0
[   56.697906]         90000001000bb8d0 900000011aa48028 0000000000000000 ffff800004f9d74c
[   56.697911]         90000001000ba000 ffff800004f9ce58 0000000000000000 ffff800005470440
[   56.697916]         ffff800004811f88 90000001000b98d0 9000000100da2aa8 90000001000bb8d0
[   56.697921]         0000000000000000 90000001000ba000 900000011aa48028 ffff800004f9d74c
[   56.697926]         ffff8000054704e8 90000001000bb8b8 90000001000ba000 0000000000000000
[   56.697931]         90000001000bb8d0 9000000006307564 9000000005e666e0 90000001752359b8
[   56.697936]         9000000008cbe400 900000000804d000 9000000005e666e0 0000000000000000
[   56.697941]         ...
[   56.697944] Call Trace:
[   56.697945] [&lt;90000000066e35c8&gt;] strstr+0x28/0x120
[   56.697950] [&lt;ffff800004f98a80&gt;] wacom_update_name+0xe0/0x300 [wacom]
[   56.698000] [&lt;ffff800004f9ce58&gt;] wacom_parse_and_register+0x338/0x900 [wacom]
[   56.698050] [&lt;ffff800004f9d74c&gt;] wacom_probe+0x32c/0x420 [wacom]
[   56.698099] [&lt;9000000006307564&gt;] hid_device_probe+0x144/0x260
[   56.698103] [&lt;9000000005e65d68&gt;] really_probe+0x208/0x540
[   56.698109] [&lt;9000000005e661dc&gt;] __driver_probe_device+0x13c/0x1e0
[   56.698112] [&lt;9000000005e66620&gt;] driver_probe_device+0x40/0x100
[   56.698116] [&lt;9000000005e6680c&gt;] __device_attach_driver+0x12c/0x180
[   56.698119] [&lt;9000000005e62bc8&gt;] bus_for_each_drv+0x88/0x160
[   56.698123] [&lt;9000000005e66468&gt;] __device_attach+0x108/0x260
[   56.698126] [&lt;9000000005e63918&gt;] device_reprobe+0x78/0x100
[   56.698129] [&lt;9000000005e62a68&gt;] bus_for_each_dev+0x88/0x160
[   56.698132] [&lt;9000000006304e54&gt;] __hid_bus_driver_added+0x34/0x80
[   56.698134] [&lt;9000000005e62bc8&gt;] bus_for_each_drv+0x88/0x160
[   56.698137] [&lt;9000000006304df0&gt;] __hid_register_driver+0x70/0xa0
[   56.698142] [&lt;9000000004e10fe4&gt;] do_one_initcall+0x104/0x320
[   56.698146] [&lt;9000000004f38150&gt;] do_init_module+0x90/0x2c0
[   56.698151] [&lt;9000000004f3a3d8&gt;] init_module_from_file+0xb8/0x120
[   56.698155] [&lt;9000000004f3a590&gt;] idempotent_init_module+0x150/0x3a0
[   56.698159] [&lt;9000000004f3a890&gt;] sys_finit_module+0xb0/0x140
[   56.698163] [&lt;900000000671e4e8&gt;] do_syscall+0x88/0xc0
[   56.698166] [&lt;9000000004e12404&gt;] handle_syscall+0xc4/0x160
[   56.698171] Code: 0011958f  00150224  5800cd85 &lt;2a00022c&gt; 00150004  4000c180  0015022c  03400000  03400000
[   56.698192] ---[ end trace 0000000000000000 ]---

Fixes: 09dc28acaec7 ("HID: wacom: Improve generic name generation")
Reported-by: Zhenxing Chen &lt;chenzhenxing@uniontech.com&gt;
Co-developed-by: Xu Rao &lt;raoxu@uniontech.com&gt;
Signed-off-by: Xu Rao &lt;raoxu@uniontech.com&gt;
Signed-off-by: WangYuli &lt;wangyuli@uniontech.com&gt;
Link: https://patch.msgid.link/B31757FE8E1544CF+20241125052616.18261-1-wangyuli@uniontech.com
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: Do not register input devices until after hid_hw_start</title>
<updated>2024-02-06T15:12:07+00:00</updated>
<author>
<name>Jason Gerecke</name>
<email>killertofu@gmail.com</email>
</author>
<published>2024-01-29T22:35:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1d6708bf0d3dd976460d435373cf5abf21ce258'/>
<id>urn:sha1:c1d6708bf0d3dd976460d435373cf5abf21ce258</id>
<content type='text'>
If a input device is opened before hid_hw_start is called, events may
not be received from the hardware. In the case of USB-backed devices,
for example, the hid_hw_start function is responsible for filling in
the URB which is submitted when the input device is opened. If a device
is opened prematurely, polling will never start because the device will
not have been in the correct state to send the URB.

Because the wacom driver registers its input devices before calling
hid_hw_start, there is a window of time where a device can be opened
and end up in an inoperable state. Some ARM-based Chromebooks in particular
reliably trigger this bug.

This commit splits the wacom_register_inputs function into two pieces.
One which is responsible for setting up the allocated inputs (and runs
prior to hid_hw_start so that devices are ready for any input events
they may end up receiving) and another which only registers the devices
(and runs after hid_hw_start to ensure devices can be immediately opened
without issue). Note that the functions to initialize the LEDs and remotes
are also moved after hid_hw_start to maintain their own dependency chains.

Fixes: 7704ac937345 ("HID: wacom: implement generic HID handling for pen generic devices")
Cc: stable@vger.kernel.org # v3.18+
Suggested-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Jason Gerecke &lt;jason.gerecke@wacom.com&gt;
Tested-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.com&gt;
</content>
</entry>
<entry>
<title>HID: wacom: Remove AES power_supply after extended inactivity</title>
<updated>2023-11-29T15:13:21+00:00</updated>
<author>
<name>Tatsunosuke Tobita</name>
<email>tatsunosuke.wacom@gmail.com</email>
</author>
<published>2023-11-14T23:57:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fd2a9b29dc9c4c35def91d5d1c5b470843539de6'/>
<id>urn:sha1:fd2a9b29dc9c4c35def91d5d1c5b470843539de6</id>
<content type='text'>
Even if a user does not use their AES pen for an extended period,
the battery power supply attributes continue to exist.
This results in the desktop showing battery status for a pen
that is no longer in use and which may in fact be in a different
state (e.g. the user may be charging the pen).
To avoid confusion and ensure userspace has an accurate view
of the battery state, this patch automatically removes
the power_supply after 30 minutes of inactivity.

Signed-off-by: Tatsunosuke Tobita &lt;tatsunosuke.tobita@wacom.com&gt;
Reviewed-by: Jason Gerecke &lt;Jason.Gerecke@wacom.com&gt;
Reviewed-by: Aaron Skomra &lt;aaron.skomra@wacom.com&gt;
Reviewed-by: Josh Dickens &lt;joshua.dickens@wacom.com&gt;
Link: https://lore.kernel.org/r/20231114235729.6867-1-tatsunosuke.wacom@gmail.com
Signed-off-by: Benjamin Tissoires &lt;bentiss@kernel.org&gt;
</content>
</entry>
<entry>
<title>HID: wacom: struct name cleanup</title>
<updated>2023-08-14T09:43:57+00:00</updated>
<author>
<name>Aaron Armstrong Skomra</name>
<email>aaron.skomra@wacom.com</email>
</author>
<published>2023-07-25T22:21:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55ab9b2c42f4ce34264213b608889c9fcbdf392f'/>
<id>urn:sha1:55ab9b2c42f4ce34264213b608889c9fcbdf392f</id>
<content type='text'>
Help differentiate the two remote related "serial" struct variables by
renaming "wacom_remote_data" to "wacom_remote_work_data".

Signed-off-by: Aaron Skomra &lt;skomra@gmail.com&gt;
Signed-off-by: Aaron Armstrong Skomra &lt;aaron.skomra@wacom.com&gt;
Reviewed-by: Jason Gerecke &lt;jason.gerecke@wacom.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: wacom: remove unnecessary 'connected' variable from EKR</title>
<updated>2023-08-14T09:43:57+00:00</updated>
<author>
<name>Aaron Armstrong Skomra</name>
<email>aaron.skomra@wacom.com</email>
</author>
<published>2023-07-25T22:20:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2834e38048f1ef9bd7473fbc33e8266ad7a24fcb'/>
<id>urn:sha1:2834e38048f1ef9bd7473fbc33e8266ad7a24fcb</id>
<content type='text'>
The 'connected' variable was poorly named, and this has led to some
confusion. We can get the same information by checking if a serial number
exists in the specified EKR slot.

Signed-off-by: Aaron Skomra &lt;skomra@gmail.com&gt;
Signed-off-by: Aaron Armstrong Skomra &lt;aaron.skomra@wacom.com&gt;
Reviewed-by: Jason Gerecke &lt;jason.gerecke@wacom.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
