Skip to content

Commit 03b80e4

Browse files
committed
HID: wacom: fix kobject reference count leak
JIRA: https://issues.redhat.com/browse/RHEL-102058 Upstream Status: v6.16 commit 85a720f Author: Qasim Ijaz <[email protected]> Date: Fri Jun 6 19:49:59 2025 +0100 HID: wacom: fix kobject reference count leak 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: 83e6b40 ("HID: wacom: EKR: have the wacom resources dynamically allocated") Acked-by: Ping Cheng <[email protected]> Cc: [email protected] Signed-off-by: Qasim Ijaz <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 8dab28e commit 03b80e4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/hid/wacom_sys.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,6 +2057,7 @@ static int wacom_initialize_remotes(struct wacom *wacom)
20572057
hid_err(wacom->hdev,
20582058
"cannot create sysfs group err: %d\n", error);
20592059
kfifo_free(&remote->remote_fifo);
2060+
kobject_put(remote->remote_dir);
20602061
return error;
20612062
}
20622063

0 commit comments

Comments
 (0)