mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 12 Dec 2022 08:41:39 +0000 (16:41 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Dec 2022 03:24:52 +0000 (19:24 -0800)
commit1232946cf522b8de9e398828bde325d7c41f29dd
tree956bcad2bd342a8b275b7605e78a7237b02d1be8
parentf0f596bd75a9d573ca9b587abb39cee0b916bb82
mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()

It is not allowed to call kfree_skb() or consume_skb() from hardware
interrupt context or with hardware interrupts being disabled.

skb_queue_purge() is called under spin_lock_irqsave() in handle_dmsg()
and hfcm_l1callback(), kfree_skb() is called in them, to fix this, use
skb_queue_splice_init() to move the dch->squeue to a free queue, also
enqueue the tx_skb and rx_skb, at last calling __skb_queue_purge() to
free the SKBs afer unlock.

Fixes: af69fb3a8ffa ("Add mISDN HFC multiport driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/isdn/hardware/mISDN/hfcmulti.c