hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/iio/industrialio-sw-trigger.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * The Industrial I/O core, software trigger functions
34 *
45 * Copyright (c) 2015 Intel Corporation
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published by
8
- * the Free Software Foundation.
96 */
107
118 #include <linux/module.h>
....@@ -61,8 +58,12 @@
6158
6259 t->group = configfs_register_default_group(iio_triggers_group, t->name,
6360 &iio_trigger_type_group_type);
64
- if (IS_ERR(t->group))
61
+ if (IS_ERR(t->group)) {
62
+ mutex_lock(&iio_trigger_types_lock);
63
+ list_del(&t->list);
64
+ mutex_unlock(&iio_trigger_types_lock);
6565 ret = PTR_ERR(t->group);
66
+ }
6667
6768 return ret;
6869 }