From 189ab46a97bcb67bac1d474031eb2e71cc62b114 Mon Sep 17 00:00:00 2001 From: Tony Battersby Date: Mon, 8 Sep 2025 15:48:45 +0300 Subject: [PATCH] scst: Fix garbage in trace_level files 'hd /sys/kernel/scst_tgt/trace_level' shows a series of extraneous nul chars at the end of the first line. Fixes: 9cbca538303f ("scst: Replace sprintf() with scnprintf() in sysfs callbacks") Signed-off-by: Tony Battersby --- scst/src/scst_sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 66c9414cf..340e73520 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -156,8 +156,8 @@ static ssize_t scst_trace_level_show(const struct scst_trace_log *local_tbl, { ssize_t ret = 0; - ret += scst_read_trace_tbl(scst_trace_tbl, buf, log_level, ret); - ret += scst_read_trace_tbl(local_tbl, buf, log_level, ret); + ret = scst_read_trace_tbl(scst_trace_tbl, buf, log_level, ret); + ret = scst_read_trace_tbl(local_tbl, buf, log_level, ret); ret += sysfs_emit_at(buf, ret, "\n\n\nUsage:\n"