scsi: Fix the name string memory leak during scsi scan
authorBin Meng <bmeng.cn@gmail.com>
Wed, 5 Nov 2025 11:07:24 +0000 (19:07 +0800)
committerTom Rini <trini@konsulko.com>
Tue, 11 Nov 2025 17:54:48 +0000 (11:54 -0600)
commitc6e8befd4b8da4a99c779a0fddd92690e2f611fa
tree311fd7b80edcd6579e7ccc60b020241b0237fd4e
parent749ec886046d1a5dff87aa41f3d46a06ef558169
scsi: Fix the name string memory leak during scsi scan

There is a memory leak during the scsi scan process due to the
strdup'ed name string is never freed. Actually it is unnecessary
to pass a strdup'ed name string to blk_create_devicef() as we can
use the name string on the stack directly.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
drivers/scsi/scsi.c