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

Commit ee49c0e9 authored by Qasim Ijaz's avatar Qasim Ijaz Committed by Greg Kroah-Hartman
Browse files

HID: wacom: fix memory leak on sysfs attribute creation failure



commit 1a19ae437ca5d5c7d9ec2678946fb339b1c706bf upstream.

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: 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 e0d64695
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2030,6 +2030,7 @@ static int wacom_initialize_remotes(struct wacom *wacom)
	if (error) {
		hid_err(wacom->hdev,
			"cannot create sysfs group err: %d\n", error);
		kfifo_free(&remote->remote_fifo);
		return error;
	}