Skip to contentSkip to conversation

kernel/params: fix a pr_debug(" %p ") in parse_one()

PATCH Applied Jim Cromie 1 participant 1 message Jun 18

lore
Share & tools
lore

Jim Cromie

author
#0 lore raw

PATCH 1/1 kernel/params: fix a pr_debug(" %p ") in parse_one()

Inside parse_one(), the core parameter-parsing engine prints the address of the parameter-set callback function using %p:
pr_debug("handling %s with %p\n", param, params[i].ops->set);

Since the string value of the parameter being parsed (val) is already available, print the parameter name and its value instead, and avoid tainting the kernel by exposing a kernel-ptr.

---
 kernel/params.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/params.c +2 -2
index 74d620bc2521..01d4e6704ebc 100644
@@ -136,8 +136,8 @@ static int parse_one(char *param,
 			if (!val &&
 			    !(params[i].ops->flags & KERNEL_PARAM_OPS_FL_NOARG))
 				return -EINVAL;
-			pr_debug("handling %s with %p\n", param,
-				params[i].ops->set);
+			pr_debug("handling %s with value '%s'\n", param,
+				val ? val : "no-arg");
 			kernel_param_lock(params[i].mod);
 			if (param_check_unsafe(&params[i]))
 				err = params[i].ops->set(val, &params[i]);
Signature · 1 line
2.54.0