diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index cd71e7133944..2407346986fb 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2744,12 +2744,12 @@ static int wacom_probe(struct hid_device *hdev, error = hid_parse(hdev); if (error) { hid_err(hdev, "parse failed\n"); - return error; + goto err; } error = wacom_parse_and_register(wacom, false); if (error) - return error; + goto err; if (hdev->bus == BUS_BLUETOOTH) { error = device_create_file(&hdev->dev, &dev_attr_speed); @@ -2760,6 +2760,10 @@ static int wacom_probe(struct hid_device *hdev, } return 0; + +err: + kfifo_free(&wacom_wac->pen_fifo); + return error; } static void wacom_remove(struct hid_device *hdev)