summaryrefslogtreecommitdiff
path: root/net/can/raw.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-31 09:39:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-07-31 09:39:56 +0200
commitfe3015748a905e08eb0e1750aa2928f520063d59 (patch)
treed15524d1f7931e8e5964e9ff8368792d09282da5 /net/can/raw.c
parent16aae4c64600a6319a6f10dbff833fa198bf9599 (diff)
parent5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 (diff)
Merge 6.5-rc4 into tty-next
We need the serial/tty fixes in here as well for testing and future development. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/can/raw.c')
-rw-r--r--net/can/raw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index 2302e4882967..ba6b52b1d776 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -386,9 +386,9 @@ static int raw_release(struct socket *sock)
list_del(&ro->notifier);
spin_unlock(&raw_notifier_lock);
+ rtnl_lock();
lock_sock(sk);
- rtnl_lock();
/* remove current filters & unregister */
if (ro->bound) {
if (ro->dev)
@@ -405,12 +405,13 @@ static int raw_release(struct socket *sock)
ro->dev = NULL;
ro->count = 0;
free_percpu(ro->uniq);
- rtnl_unlock();
sock_orphan(sk);
sock->sk = NULL;
release_sock(sk);
+ rtnl_unlock();
+
sock_put(sk);
return 0;