Message ID | 40393903-1414-5188-4fae-ccaad0f2fe72@sberdevices.ru (mailing list archive) |
---|---|
State | Accepted |
Commit | b8d2f61fdf2a566f7872158f35e65599aceb90fb |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | fix header length on skb merging | expand |
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index b9144af71553..f0187659289f 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -398,6 +398,13 @@ virtio_transport_stream_do_dequeue(struct vsock_sock *vsk, u32 free_space; spin_lock_bh(&vvs->rx_lock); + + if (WARN_ONCE(skb_queue_empty(&vvs->rx_queue) && vvs->rx_bytes, + "rx_queue is empty, but rx_bytes is non-zero\n")) { + spin_unlock_bh(&vvs->rx_lock); + return err; + } + while (total < len && !skb_queue_empty(&vvs->rx_queue)) { skb = skb_peek(&vvs->rx_queue);