Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e0d64695 authored by Qasim Ijaz's avatar Qasim Ijaz Committed by Greg Kroah-Hartman
Browse files

HID: wacom: fix memory leak on kobject creation failure



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: 83e6b40e ("HID: wacom: EKR: have the wacom resources dynamically allocated")
Reviewed-by: default avatarPing Cheng <ping.cheng@wacom.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarQasim Ijaz <qasdev00@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a30260dc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment