Skip to content

Commit 33ea970

Browse files
calebsanderigaw
authored andcommitted
tree: fix incorrect return value
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 <[email protected]>
1 parent 0da1f66 commit 33ea970

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ static int nvme_scan_subsystem(struct nvme_root *r, const char *name,
725725
if (strcmp(_s->name, name))
726726
continue;
727727
if (!__nvme_scan_subsystem(r, _s, f, f_args)) {
728-
errno = -EINVAL;
728+
ret = -EINVAL;
729729
goto out_free;
730730
}
731731
s = _s;

0 commit comments

Comments
 (0)