From a02b101be882535f84b7b51b41b14d4e4b03e89e Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Sat, 30 Oct 2021 09:44:04 -0600 Subject: [PATCH] Fix input device error handling Managed devices do not need to be explicitly unregistered or freed, as this is handled by devres. Drop the call to input_free_device. Signed-off-by: Tim Crawford --- system76_acpi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/system76_acpi.c b/system76_acpi.c index 84273a1..b6b361e 100644 --- a/system76_acpi.c +++ b/system76_acpi.c @@ -732,10 +732,8 @@ static int system76_add(struct acpi_device *acpi_dev) input_set_capability(data->input, EV_KEY, KEY_SCREENLOCK); err = input_register_device(data->input); - if (err) { - input_free_device(data->input); - return err; - } + if (err) + goto error; err = system76_get_object(data, "NFAN", &data->nfan); if (err)