Skip to content

Commit 1a19ae4

Browse files
qasim-ijazJiri Kosina
authored andcommitted
HID: wacom: fix memory leak on sysfs attribute creation failure
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: 83e6b40 ("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>
1 parent 5ae416c commit 1a19ae4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/hid/wacom_sys.c

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

0 commit comments

Comments
 (0)