]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: fix kobject reference count leak
authorQasim Ijaz <qasdev00@gmail.com>
Fri, 6 Jun 2025 18:49:59 +0000 (19:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:58:01 +0000 (10:58 +0200)
commitbfeaa1c2a1e689d3c4a6d83fe0201a8efebb87c2
treed46c7b49854d0d59ae1851bc60d495b3fda0e07e
parent1c1718c40943965b966a9c2ec5f29b0b14b82cba
HID: wacom: fix kobject reference count leak

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 <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