Skip to contentSkip to conversation

params: Remove redundant perm check in add_sysfs_param

PATCH New Jiazi Li (transsion) 1 participant 1 message May 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 params: Remove redundant perm check in add_sysfs_param

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.

---
 kernel/params.c | 3 ---
 1 file changed, 3 deletions(-)
kernel/params.c +0 -3
index 74d620bc2521..a6b81fda4214 100644
@@ -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);
Signature · 1 line
2.49.0