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

Commit 55dba524 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

HID: fix memory leak on error path in debug code



If hid_get_report() fails, we forgot to free the already allocated buffer
for debugging messages on error path. Fix that up.

Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 38b7f49a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1100,8 +1100,10 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
	hid_debug_event(hid, buf);

	report = hid_get_report(report_enum, data);
	if (!report)
	if (!report) {
		kfree(buf);
		return -1;
	}

	/* dump the report */
	snprintf(buf, HID_DEBUG_BUFSIZE - 1,