There are two place where this function is called:
1. module_param_sysfs_setup //there is a check in this func
->add_sysfs_param
2. param_sysfs_builtin //there is a check in this func
->kernel_add_sysfs_param
->add_sysfs_param
So remove redundant perm check in add_sysfs_param.
Signed-off-by: Jiazi Li (transsion) <jqqlijiazi@gmail.com>
---
kernel/params.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/kernel/params.c b/kernel/params.c
index 74d620bc2521..a6b81fda4214 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -628,9 +628,6 @@ static __init_or_module int add_sysfs_param(struct module_kobject *mk,
struct attribute **new_attrs;
unsigned int i;
- /* We don't bother calling this with invisible parameters. */
- BUG_ON(!kp->perm);
-
if (!mk->mp) {
/* First allocation. */
mk->mp = kzalloc_obj(*mk->mp);
--
2.49.0