VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Lin Ma <linma@zju.edu.cn> 2021-12-17 10:29:41 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-12-29 12:29:02 +0100 commit: a8e4a64cdc977cda02d7c95cd01004fd33978ab7 parent: f547b0f8f3ceb1eb544b7df1df0196c0f834580c
Commit Summary:
ax25: NPD bug when detaching AX25 device
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 2631efc6e359..aa7785687e75 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -85,8 +85,10 @@ static void ax25_kill_by_device(struct net_device *dev)
 again:
 	ax25_for_each(s, &ax25_list) {
 		if (s->ax25_dev == ax25_dev) {
-			s->ax25_dev = NULL;
 			spin_unlock_bh(&ax25_list_lock);
+			lock_sock(s->sk);
+			s->ax25_dev = NULL;
+			release_sock(s->sk);
 			ax25_disconnect(s, ENETUNREACH);
 			spin_lock_bh(&ax25_list_lock);