On Wed, 6 Mar 2019 09:12:36 +0100, Stefano Garzarella <sgarz...@redhat.com> 
wrote:
> > --- a/net/vmw_vsock/virtio_transport_common.c
> > +++ b/net/vmw_vsock/virtio_transport_common.c
> > @@ -662,6 +662,7 @@ static int virtio_transport_reset(struct vsock_sock 
> > *vsk,
> >   */
> >  static int virtio_transport_reset_no_sock(struct virtio_vsock_pkt *pkt)
> >  {
> > +   const struct virtio_transport *t;
> >     struct virtio_vsock_pkt_info info = {
> >             .op = VIRTIO_VSOCK_OP_RST,
> >             .type = le16_to_cpu(pkt->hdr.type),
> > @@ -680,7 +681,11 @@ static int virtio_transport_reset_no_sock(struct 
> > virtio_vsock_pkt *pkt)
> >     if (!pkt)
> >             return -ENOMEM;
> >  
> > -   return virtio_transport_get_ops()->send_pkt(pkt);
> > +   t = virtio_transport_get_ops();
> > +   if (!t)
> > +           return -ENOTCONN;
> 
> Should be better to do this check before the virtio_transport_alloc_pkt?
> 
> Otherwise, I think we should free that packet before to return -ENOTCONN.

Right! :D
I will send a second version.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to