nvme_scan_subsystem() accidentally sets errno = -EINVAL
if the matching subsystem is filtered out.
This errno value will be overwritten by the out_free path with -ret,
where ret is the length of the path string.
Set ret = -EINVAL instead, so errno will be set to EINVAL.
This matches the behavior in the case where a new subsystem is allocated
and fails the filter function.
Signed-off-by: Caleb Sander <csander@purestorage.com>
if (strcmp(_s->name, name))
continue;
if (!__nvme_scan_subsystem(r, _s, f, f_args)) {
- errno = -EINVAL;
+ ret = -EINVAL;
goto out_free;
}
s = _s;