From 9bc47ecdce7959bc50ce7ea8f3d05d4cf626c1ae Mon Sep 17 00:00:00 2001 From: Fotis Panagiotopoulos Date: Thu, 25 Aug 2022 02:00:26 +0300 Subject: [PATCH] Added lock in ifr ioctl calls. --- net/netdev/netdev_ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netdev/netdev_ioctl.c b/net/netdev/netdev_ioctl.c index 2f5a44f94d..b33871f09c 100644 --- a/net/netdev/netdev_ioctl.c +++ b/net/netdev/netdev_ioctl.c @@ -641,6 +641,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd, ninfo("cmd: %d\n", cmd); + net_lock(); + /* Execute the command */ switch (cmd) @@ -1139,6 +1141,8 @@ static int netdev_ifr_ioctl(FAR struct socket *psock, int cmd, break; } + net_unlock(); + return ret; }