diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index cd71e7133944..71ac08e4bc95 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -2700,7 +2700,7 @@ static int wacom_probe(struct hid_device *hdev, struct wacom *wacom; struct wacom_wac *wacom_wac; struct wacom_features *features; - int error; + int error = 0; if (!id->driver_data) return -EINVAL; @@ -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); @@ -2759,7 +2759,10 @@ static int wacom_probe(struct hid_device *hdev, error); } - return 0; + return error; +err: + kfifo_free(&wacom_wac->pen_fifo); + return error; } static void wacom_remove(struct hid_device *hdev)