In transport_dump_vpd_ident_type() we try to call strlen() on the integer len which is obviously a typo; take the length of the string already in buf instead.
Fixes: 6cfa853ceee4a (target: target_core_transport.c: Cleaning up missing null-terminate in conjunction with strncpy) Signed-off-by: Mark Brown broonie@kernel.org --- drivers/target/target_core_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 1dd11818f38f..3ce85edc2ea9 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -953,7 +953,7 @@ int transport_dump_vpd_ident_type( strlcat(buf, "SCSI name string\n", sizeof(buf)); break; default: - len = strlen(len); + len = strlen(buf); snprintf(&buf[len], sizeof(buf) - len, "Unsupported: 0x%02x\n", vpd->device_identifier_type); ret = -EINVAL;