public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] tst_netdevice: Add missing rtnetlink context allocation checks
@ 2023-07-27 15:00 Martin Doucha
  2023-07-27 15:00 ` [LTP] [PATCH 2/3] tst_netdevice: Add helper functions for qdisc and filter management Martin Doucha
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Martin Doucha @ 2023-07-27 15:00 UTC (permalink / raw)
  To: ltp

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 lib/tst_netdevice.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/tst_netdevice.c b/lib/tst_netdevice.c
index 4a0442932..a57f506e9 100644
--- a/lib/tst_netdevice.c
+++ b/lib/tst_netdevice.c
@@ -332,6 +332,9 @@ static int change_ns(const char *file, const int lineno, const char *ifname,
 
 	ctx = create_request(file, lineno, RTM_NEWLINK, 0, &info, sizeof(info));
 
+	if (!ctx)
+		return 0;
+
 	if (!tst_rtnl_add_attr_string(file, lineno, ctx, IFLA_IFNAME, ifname)) {
 		tst_rtnl_destroy_context(file, lineno, ctx);
 		return 0;
@@ -411,6 +414,9 @@ static int modify_route(const char *file, const int lineno, unsigned int action,
 
 	ctx = create_request(file, lineno, action, flags, &info, sizeof(info));
 
+	if (!ctx)
+		return 0;
+
 	if (srcaddr && !tst_rtnl_add_attr(file, lineno, ctx, RTA_SRC, srcaddr,
 		srclen)) {
 		tst_rtnl_destroy_context(file, lineno, ctx);
-- 
2.41.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-04 13:38 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27 15:00 [LTP] [PATCH 1/3] tst_netdevice: Add missing rtnetlink context allocation checks Martin Doucha
2023-07-27 15:00 ` [LTP] [PATCH 2/3] tst_netdevice: Add helper functions for qdisc and filter management Martin Doucha
2023-07-28  7:53   ` Cyril Hrubis
2023-07-28  8:21     ` Martin Doucha
2023-07-28 12:09   ` Petr Vorel
2023-07-27 15:00 ` [LTP] [PATCH 3/3] Add test for CVE 2023-1829 Martin Doucha
2023-07-28  8:36   ` Petr Vorel
2023-08-03 12:51     ` Cyril Hrubis
2023-08-04  9:23   ` Martin Doucha
2023-07-28  7:46 ` [LTP] [PATCH 1/3] tst_netdevice: Add missing rtnetlink context allocation checks Cyril Hrubis
2023-07-28  8:17   ` Martin Doucha
2023-07-28  8:45     ` Cyril Hrubis
2023-07-28 11:43 ` Petr Vorel
2023-08-04 13:28 ` [LTP] [PATCH v2 3/3] Add test for CVE 2023-1829 Martin Doucha
2023-08-04 13:38   ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox