diff options
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 0329c411bbf..57203014c45 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -213,12 +213,13 @@ static int peek_head_len(struct sock *sk) | |||
213 | { | 213 | { |
214 | struct sk_buff *head; | 214 | struct sk_buff *head; |
215 | int len = 0; | 215 | int len = 0; |
216 | unsigned long flags; | ||
216 | 217 | ||
217 | lock_sock(sk); | 218 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); |
218 | head = skb_peek(&sk->sk_receive_queue); | 219 | head = skb_peek(&sk->sk_receive_queue); |
219 | if (head) | 220 | if (likely(head)) |
220 | len = head->len; | 221 | len = head->len; |
221 | release_sock(sk); | 222 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); |
222 | return len; | 223 | return len; |
223 | } | 224 | } |
224 | 225 | ||