]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: fix memory leak on sysfs attribute creation failure
authorQasim Ijaz <qasdev00@gmail.com>
Fri, 6 Jun 2025 18:49:58 +0000 (19:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 13:57:40 +0000 (15:57 +0200)
commit796abf9f710ae008674936ab499a70f535d8324c
tree79c92bf9067cba7d1704ab34aea9521ab8fda9a2
parentca7b6d00a713c6fd302f81eaf8453adf9c2cf1d4
HID: wacom: fix memory leak on sysfs attribute creation failure

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 <ping.cheng@wacom.com>
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_sys.c