From 42d3bb9ba363d23f141b128513fcc8f5137d3e4f Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 4 Apr 2024 19:49:58 +0300 Subject: fix error ladder in tmff2_wheel_init --- src/hid-tmff2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hid-tmff2.c b/src/hid-tmff2.c index ee4232a..0e0c60b 100644 --- a/src/hid-tmff2.c +++ b/src/hid-tmff2.c @@ -558,7 +558,7 @@ static int tmff2_wheel_init(struct tmff2_device_entry *tmff2) /* create actual ff device*/ if ((ret = input_ff_create(tmff2->input_dev, tmff2->max_effects))) { hid_err(tmff2->hdev, "could not create input_ff\n"); - goto err; + goto ff_err; } /* set ff callbacks */ @@ -589,12 +589,15 @@ static int tmff2_wheel_init(struct tmff2_device_entry *tmff2) /* create files */ if ((ret = tmff2_create_files(tmff2))) - goto err; + goto file_err; tmff2->allow_scheduling = 1; return 0; +file_err: input_ff_destroy(tmff2->input_dev); +ff_err: + kfree(tmff2->states); err: return ret; } -- cgit v1.3