aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace_probe.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 4cc2d467d34c..e0d1d5353464 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -533,13 +533,14 @@ static int traceprobe_parse_probe_arg_body(char *arg, ssize_t *size,
533 } 533 }
534 } 534 }
535 } 535 }
536 /* 536
537 * The default type of $comm should be "string", and it can't be 537 /* Since $comm can not be dereferred, we can find $comm by strcmp */
538 * dereferenced. 538 if (strcmp(arg, "$comm") == 0) {
539 */ 539 /* The type of $comm must be "string", and not an array. */
540 if (!t && strcmp(arg, "$comm") == 0) 540 if (parg->count || (t && strcmp(t, "string")))
541 return -EINVAL;
541 parg->type = find_fetch_type("string"); 542 parg->type = find_fetch_type("string");
542 else 543 } else
543 parg->type = find_fetch_type(t); 544 parg->type = find_fetch_type(t);
544 if (!parg->type) { 545 if (!parg->type) {
545 trace_probe_log_err(offset + (t ? (t - arg) : 0), BAD_TYPE); 546 trace_probe_log_err(offset + (t ? (t - arg) : 0), BAD_TYPE);