Re: [PATCH] nvme: work around -Wformat-security warning

From: Nilay Shroff

Date: Thu Sep 17 2026 - 04:20:23 EST


On 9/16/26 5:14 PM, Arnd Bergmann wrote:
From: Arnd Bergmann<arnd@xxxxxxxx>

Passing a string variable into dev_set_name() causes a warning
when building with -Wformat-security enabled:

drivers/nvme/host/core.c: In function 'nvme_cdev_add':
drivers/nvme/host/core.c:3911:9: error: format not a string literal and no format arguments [-Werror=format-security]
3911 | ret = dev_set_name(cdev_device, name);

Remove the temporary strings and let dev_set_name() do the
same thing internally.

Fixes: 26acdaa357cd ("nvme: fix crash and memory leak during invalid cdev teardown")
Signed-off-by: Arnd Bergmann<arnd@xxxxxxxx>

Looks good to me.
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>