Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a484516 authored by Cong Wang's avatar Cong Wang Committed by Greg Kroah-Hartman
Browse files

llc: avoid blocking in llc_sap_close()



[ Upstream commit 9708d2b5b7c648e8e0a40d11e8cea12f6277f33c ]

llc_sap_close() is called by llc_sap_put() which
could be called in BH context in llc_rcv(). We can't
block in BH.

There is no reason to block it here, kfree_rcu() should
be sufficient.

Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 50e40ebc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ struct llc_sap {
	int sk_count;
	struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES];
	struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES];
	struct rcu_head rcu;
};

static inline
+1 −3
Original line number Diff line number Diff line
@@ -127,9 +127,7 @@ void llc_sap_close(struct llc_sap *sap)
	list_del_rcu(&sap->node);
	spin_unlock_bh(&llc_sap_list_lock);

	synchronize_rcu();

	kfree(sap);
	kfree_rcu(sap, rcu);
}

static struct packet_type llc_packet_type __read_mostly = {