Skip to content

Commit c1011c0

Browse files
stefano-garzarellakuba-moo
authored andcommitted
vsock/virtio: read the negotiated features before using VQs
Complete the driver configuration, reading the negotiated features, before using the VQs in the virtio_vsock_probe(). Fixes: 53efbba ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 4b5f1ad commit c1011c0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

net/vmw_vsock/virtio_transport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,9 @@ static int virtio_vsock_probe(struct virtio_device *vdev)
622622
INIT_WORK(&vsock->event_work, virtio_transport_event_work);
623623
INIT_WORK(&vsock->send_pkt_work, virtio_transport_send_pkt_work);
624624

625+
if (virtio_has_feature(vdev, VIRTIO_VSOCK_F_SEQPACKET))
626+
vsock->seqpacket_allow = true;
627+
625628
vdev->priv = vsock;
626629

627630
mutex_lock(&vsock->tx_lock);
@@ -638,9 +641,6 @@ static int virtio_vsock_probe(struct virtio_device *vdev)
638641
vsock->event_run = true;
639642
mutex_unlock(&vsock->event_lock);
640643

641-
if (virtio_has_feature(vdev, VIRTIO_VSOCK_F_SEQPACKET))
642-
vsock->seqpacket_allow = true;
643-
644644
rcu_assign_pointer(the_virtio_vsock, vsock);
645645

646646
mutex_unlock(&the_virtio_vsock_mutex);

0 commit comments

Comments
 (0)