Skip to content

Commit

Permalink
mISDN: Fix a sleep-in-atomic bug
Browse files Browse the repository at this point in the history
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: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jia-Ju Bai authored and David S. Miller committed Jun 1, 2017
1 parent 35cf284 commit 93818da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/isdn/mISDN/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb)
if (sk->sk_state != MISDN_BOUND)
continue;
if (!cskb)
cskb = skb_copy(skb, GFP_KERNEL);
cskb = skb_copy(skb, GFP_ATOMIC);
if (!cskb) {
printk(KERN_WARNING "%s no skb\n", __func__);
break;
Expand Down

0 comments on commit 93818da

Please sign in to comment.