net/vmw_vsock: fix NULL pointer dereference
[linux-2.6-microblaze.git] / net / vmw_vsock / af_vsock.c
index 6894f21..cb81cfb 100644 (file)
@@ -1233,7 +1233,7 @@ static int vsock_transport_cancel_pkt(struct vsock_sock *vsk)
 {
        const struct vsock_transport *transport = vsk->transport;
 
-       if (!transport->cancel_pkt)
+       if (!transport || !transport->cancel_pkt)
                return -EOPNOTSUPP;
 
        return transport->cancel_pkt(vsk);