Merge tag 'kvm-arm-for-v4.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / net / macvtap.c
index 197c939..54036ae 100644 (file)
@@ -935,6 +935,9 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q,
                /* Nothing to read, let's sleep */
                schedule();
        }
+       if (!noblock)
+               finish_wait(sk_sleep(&q->sk), &wait);
+
        if (skb) {
                ret = macvtap_put_user(q, skb, to);
                if (unlikely(ret < 0))
@@ -942,8 +945,6 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q,
                else
                        consume_skb(skb);
        }
-       if (!noblock)
-               finish_wait(sk_sleep(&q->sk), &wait);
        return ret;
 }