[PATCH] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn()
Chaitanya Kulkarni
Chaitanya.Kulkarni at wdc.com
Mon Feb 1 18:56:03 EST 2021
On 2/1/21 14:41, mwilck at suse.com wrote:
> - return snprintf(buf, PAGE_SIZE, "%s\n", ctrl->subsys->subnqn);
> + if (ctrl->subsys)
> + subsysnqn = ctrl->subsys->subnqn;
> + else if (ctrl->opts && ctrl->opts->subsysnqn)
> + subsysnqn = ctrl->opts->subsysnqn;
> + else
> + subsysnqn = "unknown";
Just initialize the subsysnqnq to unknown string at the time of declaration.
Also, can you please add a testcase for this bug in blktests to make
sure this
behavior will not repeat ?
More information about the Linux-nvme
mailing list