Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03e9f8a0 authored by Yunjian Wang's avatar Yunjian Wang Committed by Michael S. Tsirkin
Browse files

virtio_net: fix return value check in receive_mergeable()



The function virtqueue_get_buf_ctx() could return NULL, the return
value 'buf' need to be checked with NULL, not value 'ctx'.

Signed-off-by: default avatarYunjian Wang <wangyunjian@huawei.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 25f32223
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -714,7 +714,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
		int num_skb_frags;

		buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx);
		if (unlikely(!ctx)) {
		if (unlikely(!buf)) {
			pr_debug("%s: rx error: %d buffers out of %d missing\n",
				 dev->name, num_buf,
				 virtio16_to_cpu(vi->vdev,