Skip to content

Commit 85a720f

Browse files
qasim-ijazJiri Kosina
authored andcommitted
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]>
1 parent 1a19ae4 commit 85a720f

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
@@ -2059,6 +2059,7 @@ static int wacom_initialize_remotes(struct wacom *wacom)
20592059
hid_err(wacom->hdev,
20602060
"cannot create sysfs group err: %d\n", error);
20612061
kfifo_free(&remote->remote_fifo);
2062+
kobject_put(remote->remote_dir);
20622063
return error;
20632064
}
20642065

0 commit comments

Comments
 (0)