Commit 93818da5 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by David S. Miller

mISDN: Fix a sleep-in-atomic bug

The driver may sleep under a read spin lock, and the function call path is:
send_socklist (acquire the lock by read_lock)
  skb_copy(GFP_KERNEL) --> may sleep

To fix it, the "GFP_KERNEL" is replaced with "GFP_ATOMIC".
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 35cf2845
...@@ -75,7 +75,7 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb) ...@@ -75,7 +75,7 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb)
if (sk->sk_state != MISDN_BOUND) if (sk->sk_state != MISDN_BOUND)
continue; continue;
if (!cskb) if (!cskb)
cskb = skb_copy(skb, GFP_KERNEL); cskb = skb_copy(skb, GFP_ATOMIC);
if (!cskb) { if (!cskb) {
printk(KERN_WARNING "%s no skb\n", __func__); printk(KERN_WARNING "%s no skb\n", __func__);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment