diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 449bd747d116e3bfe1d10cf8e5d17c4e8660961c..86c2ff2429d828db35df240329bcdfb7dc1331ee 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -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,