Re: [PATCH net-next] vsock: avoid to assign transport if its initialization fails

From: David Miller
Date: Thu Nov 21 2019 - 14:37:50 EST

From: Stefano Garzarella <sgarzare@xxxxxxxxxx>
Date: Thu, 21 Nov 2019 10:06:09 +0100

> If transport->init() fails, we can't assign the transport to the
> socket, because it's not initialized correctly, and any future
> calls to the transport callbacks would have an unexpected behavior.
> Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
> Reported-and-tested-by: syzbot+e2e5c07bf353b2f79daa@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>