From: Bart Van Assche Date: Mon, 27 Oct 2025 18:46:38 +0000 (-0700) Subject: scsi: target: Do not write NUL characters into ASCII configfs output X-Git-Tag: v6.19-rc1~95^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c03b55f235e283cae49c88b9602fd11096b92eba;p=thirdparty%2Fkernel%2Flinux.git scsi: target: Do not write NUL characters into ASCII configfs output NUL characters are not allowed in ASCII configfs output. Hence this patch. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Bart Van Assche Link: https://patch.msgid.link/20251027184639.3501254-2-bvanassche@acm.org Signed-off-by: Martin K. Petersen --- diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 5470c1258445a..7e63bc71b3555 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -2787,7 +2787,6 @@ static ssize_t target_lu_gp_members_show(struct config_item *item, char *page) cur_len = snprintf(buf, LU_GROUP_NAME_BUF, "%s/%s\n", config_item_name(&hba->hba_group.cg_item), config_item_name(&dev->dev_group.cg_item)); - cur_len++; /* Extra byte for NULL terminator */ if ((cur_len + len) > PAGE_SIZE || cur_len > LU_GROUP_NAME_BUF) { pr_warn("Ran out of lu_gp_show_attr"