1

virtio/vsock: Improve MSG_ZEROCOPY error handling

Add a missing kfree_skb() to prevent memory leaks.

Fixes: 581512a6dc ("vsock/virtio: MSG_ZEROCOPY flag support")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Acked-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Michal Luczaj 2024-11-07 21:46:14 +01:00 committed by Paolo Abeni
parent fbf7085b3a
commit 60cf6206a1

View File

@ -400,6 +400,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
if (virtio_transport_init_zcopy_skb(vsk, skb, if (virtio_transport_init_zcopy_skb(vsk, skb,
info->msg, info->msg,
can_zcopy)) { can_zcopy)) {
kfree_skb(skb);
ret = -ENOMEM; ret = -ENOMEM;
break; break;
} }