Lines Matching refs:kbuf
36 char *kbuf; in user_input_str() local
43 kbuf = kmalloc(count + 1, GFP_KERNEL | __GFP_NOWARN); in user_input_str()
44 if (!kbuf) in user_input_str()
47 ret = simple_write_to_buffer(kbuf, count + 1, ppos, buf, count); in user_input_str()
49 kfree(kbuf); in user_input_str()
52 kbuf[ret] = '\0'; in user_input_str()
54 return kbuf; in user_input_str()
61 char kbuf[128]; in dbgfs_attrs_read() local
65 ret = scnprintf(kbuf, ARRAY_SIZE(kbuf), "%lu %lu %lu %lu %lu\n", in dbgfs_attrs_read()
71 return simple_read_from_buffer(buf, count, ppos, kbuf, ret); in dbgfs_attrs_read()
79 char *kbuf; in dbgfs_attrs_write() local
82 kbuf = user_input_str(buf, count, ppos); in dbgfs_attrs_write()
83 if (IS_ERR(kbuf)) in dbgfs_attrs_write()
84 return PTR_ERR(kbuf); in dbgfs_attrs_write()
86 if (sscanf(kbuf, "%lu %lu %lu %lu %lu", in dbgfs_attrs_write()
107 kfree(kbuf); in dbgfs_attrs_write()
174 char *kbuf; in dbgfs_schemes_read() local
177 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_schemes_read()
178 if (!kbuf) in dbgfs_schemes_read()
182 len = sprint_schemes(ctx, kbuf, count); in dbgfs_schemes_read()
186 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_schemes_read()
189 kfree(kbuf); in dbgfs_schemes_read()
298 char *kbuf; in dbgfs_schemes_write() local
302 kbuf = user_input_str(buf, count, ppos); in dbgfs_schemes_write()
303 if (IS_ERR(kbuf)) in dbgfs_schemes_write()
304 return PTR_ERR(kbuf); in dbgfs_schemes_write()
306 schemes = str_to_schemes(kbuf, count, &nr_schemes); in dbgfs_schemes_write()
326 kfree(kbuf); in dbgfs_schemes_write()
492 char *kbuf; in dbgfs_target_ids_write() local
497 kbuf = user_input_str(buf, count, ppos); in dbgfs_target_ids_write()
498 if (IS_ERR(kbuf)) in dbgfs_target_ids_write()
499 return PTR_ERR(kbuf); in dbgfs_target_ids_write()
501 if (!strncmp(kbuf, "paddr\n", count)) { in dbgfs_target_ids_write()
507 target_pids = str_to_pids(kbuf, count, &nr_targets); in dbgfs_target_ids_write()
545 kfree(kbuf); in dbgfs_target_ids_write()
575 char *kbuf; in dbgfs_init_regions_read() local
578 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_init_regions_read()
579 if (!kbuf) in dbgfs_init_regions_read()
589 len = sprint_init_regions(ctx, kbuf, count); in dbgfs_init_regions_read()
593 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_init_regions_read()
596 kfree(kbuf); in dbgfs_init_regions_read()
670 char *kbuf; in dbgfs_init_regions_write() local
674 kbuf = user_input_str(buf, count, ppos); in dbgfs_init_regions_write()
675 if (IS_ERR(kbuf)) in dbgfs_init_regions_write()
676 return PTR_ERR(kbuf); in dbgfs_init_regions_write()
684 err = set_init_regions(ctx, kbuf, ret); in dbgfs_init_regions_write()
690 kfree(kbuf); in dbgfs_init_regions_write()
698 char *kbuf; in dbgfs_kdamond_pid_read() local
701 kbuf = kmalloc(count, GFP_KERNEL | __GFP_NOWARN); in dbgfs_kdamond_pid_read()
702 if (!kbuf) in dbgfs_kdamond_pid_read()
707 len = scnprintf(kbuf, count, "%d\n", ctx->kdamond->pid); in dbgfs_kdamond_pid_read()
709 len = scnprintf(kbuf, count, "none\n"); in dbgfs_kdamond_pid_read()
713 len = simple_read_from_buffer(buf, count, ppos, kbuf, len); in dbgfs_kdamond_pid_read()
716 kfree(kbuf); in dbgfs_kdamond_pid_read()
862 char *kbuf; in dbgfs_mk_context_write() local
866 kbuf = user_input_str(buf, count, ppos); in dbgfs_mk_context_write()
867 if (IS_ERR(kbuf)) in dbgfs_mk_context_write()
868 return PTR_ERR(kbuf); in dbgfs_mk_context_write()
871 kfree(kbuf); in dbgfs_mk_context_write()
876 if (sscanf(kbuf, "%s", ctx_name) != 1) { in dbgfs_mk_context_write()
888 kfree(kbuf); in dbgfs_mk_context_write()
968 char *kbuf; in dbgfs_rm_context_write() local
972 kbuf = user_input_str(buf, count, ppos); in dbgfs_rm_context_write()
973 if (IS_ERR(kbuf)) in dbgfs_rm_context_write()
974 return PTR_ERR(kbuf); in dbgfs_rm_context_write()
977 kfree(kbuf); in dbgfs_rm_context_write()
982 if (sscanf(kbuf, "%s", ctx_name) != 1) { in dbgfs_rm_context_write()
994 kfree(kbuf); in dbgfs_rm_context_write()
1015 char *kbuf; in dbgfs_monitor_on_write() local
1017 kbuf = user_input_str(buf, count, ppos); in dbgfs_monitor_on_write()
1018 if (IS_ERR(kbuf)) in dbgfs_monitor_on_write()
1019 return PTR_ERR(kbuf); in dbgfs_monitor_on_write()
1022 if (sscanf(kbuf, "%s", kbuf) != 1) { in dbgfs_monitor_on_write()
1023 kfree(kbuf); in dbgfs_monitor_on_write()
1028 if (!strncmp(kbuf, "on", count)) { in dbgfs_monitor_on_write()
1033 kfree(kbuf); in dbgfs_monitor_on_write()
1039 } else if (!strncmp(kbuf, "off", count)) { in dbgfs_monitor_on_write()
1048 kfree(kbuf); in dbgfs_monitor_on_write()