From 0159726da5794eecddc2a949ec46afccd6552fc3 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 2 Feb 2020 15:24:17 +0800 Subject: [PATCH] drivers/net/slip.c: It's enough to only hold the net lock in SLIP driver --- drivers/net/slip.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 646e2ad192..bdd2481bbf 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -460,12 +460,6 @@ static int slip_txtask(int argc, FAR char *argv[]) if (priv->bifup) { - /* Get exclusive access to the network (if it it is already being - * used slip_rxtask, then we have to wait). - */ - - slip_semtake(priv); - /* Poll the networking layer for new XMIT data. */ net_lock(); @@ -490,7 +484,6 @@ static int slip_txtask(int argc, FAR char *argv[]) } net_unlock(); - slip_semgive(priv); } } @@ -705,11 +698,10 @@ static int slip_rxtask(int argc, FAR char *argv[]) /* Handle the IP input. Get exclusive access to the network. */ - slip_semtake(priv); + net_lock(); priv->dev.d_buf = priv->rxbuf; priv->dev.d_len = priv->rxlen; - net_lock(); NETDEV_RXPACKETS(&priv->dev); /* All packets are assumed to be IP packets (we don't have a choice.. @@ -759,7 +751,6 @@ static int slip_rxtask(int argc, FAR char *argv[]) } net_unlock(); - slip_semgive(priv); } /* We won't get here */