Skip to content

Commit

Permalink
[nrf fromtree] net: Remove unnecessary lock
Browse files Browse the repository at this point in the history
The main action in this function it queueing the packet for
transmission which doesn't need a lock and interface flags use atomic
operations.

So, remove the unnecessary lock.

Signed-off-by: Chaitanya Tata <[email protected]>
(cherry picked from commit ed17320)
  • Loading branch information
krish2718 authored and rlubos committed Nov 10, 2023
1 parent 196bab5 commit 2a8c218
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions subsys/net/ip/net_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,6 @@ enum net_verdict net_if_send_data(struct net_if *iface, struct net_pkt *pkt)
enum net_verdict verdict = NET_OK;
int status = -EIO;

net_if_lock(iface);

if (!net_if_flag_is_set(iface, NET_IF_LOWER_UP) ||
net_if_flag_is_set(iface, NET_IF_SUSPENDED)) {
/* Drop packet if interface is not up */
Expand Down Expand Up @@ -532,8 +530,6 @@ enum net_verdict net_if_send_data(struct net_if *iface, struct net_pkt *pkt)
net_if_queue_tx(iface, pkt);
}

net_if_unlock(iface);

return verdict;
}

Expand Down

0 comments on commit 2a8c218

Please sign in to comment.