diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index e73ce652bf3c3c291a12e95d26cdbd24747a7467..ed1664e7bd88840c4e336628efa76048e55f37c0 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -498,9 +498,11 @@ static bool virtio_transport_seqpacket_allow(u32 remote_cid) struct virtio_vsock *vsock; bool seqpacket_allow; + seqpacket_allow = false; rcu_read_lock(); vsock = rcu_dereference(the_virtio_vsock); - seqpacket_allow = vsock->seqpacket_allow; + if (vsock) + seqpacket_allow = vsock->seqpacket_allow; rcu_read_unlock(); return seqpacket_allow;