[PATCH] net: ynl: return actual error code in ynl_exec_dump()

From: Haofeng Li

Date: Fri Sep 26 2025 - 06:17:16 EST


From: Haofeng Li <lihaofeng@xxxxxxxxxx>

Return the real error code 'err' instead of hardcoded -1 in the error
path of ynl_exec_dump(). This provides better error information to
callers for debugging and error handling.

Signed-off-by: Haofeng Li <lihaofeng@xxxxxxxxxx>
---
tools/net/ynl/lib/ynl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/net/ynl/lib/ynl.c b/tools/net/ynl/lib/ynl.c
index 2a169c3c0797..1a79adcc3ac0 100644
--- a/tools/net/ynl/lib/ynl.c
+++ b/tools/net/ynl/lib/ynl.c
@@ -1064,5 +1064,5 @@ int ynl_exec_dump(struct ynl_sock *ys, struct nlmsghdr *req_nlh,

err_close_list:
yds->first = ynl_dump_end(yds);
- return -1;
+ return err;
}
--
2.25.1