[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240218194309.31482-1-maks.mishinFZ@gmail.com>
Date: Sun, 18 Feb 2024 22:43:09 +0300
From: Maks Mishin <maks.mishinfz@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: Maks Mishin <maks.mishinFZ@...il.com>,
netdev@...r.kernel.org
Subject: [PATCH] ctrl: Add check for result rtnl_dump_filter()
Added check for result of rtnl_dump_filter() function
for catch errors linked with dump.
Found by RASU JSC.
Signed-off-by: Maks Mishin <maks.mishinFZ@...il.com>
---
genl/ctrl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/genl/ctrl.c b/genl/ctrl.c
index aff922a4..467a2830 100644
--- a/genl/ctrl.c
+++ b/genl/ctrl.c
@@ -313,7 +313,10 @@ static int ctrl_list(int cmd, int argc, char **argv)
goto ctrl_done;
}
- rtnl_dump_filter(&rth, print_ctrl2, stdout);
+ if (rtnl_dump_filter(&rth, print_ctrl2, stdout) < 0) {
+ fprintf(stderr, "Dump terminated\n");
+ exit(1);
+ }
}
--
2.30.2
Powered by blists - more mailing lists