If nl_sock_join_mcgroup() returns an error, the 'sock' is freed
and set to NULL. So we should add NULL check of 'sock' before calling
nl_sock_listen_all_nsid().
Fixes: cf114a7fce80 ("netlink linux: enable listening to all nsids")
Cc: Flavio Leitner <[email protected]>
Signed-off-by: Yunjian Wang <[email protected]>
---
lib/netdev-linux.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 60dd13891..7fec5f5a6 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -636,7 +636,9 @@ netdev_linux_notify_sock(void)
}
}
}
- nl_sock_listen_all_nsid(sock, true);
+ if (sock) {
+ nl_sock_listen_all_nsid(sock, true);
+ }
ovsthread_once_done(&once);
}
--
2.18.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev