The function vhost_kernel_tap_set_offload() could return errors, the return value need to be checked.
Fixes: 1db4d2330bc8 ("net/virtio-user: check negotiated features before set") Cc: sta...@dpdk.org Signed-off-by: Yunjian Wang <wangyunj...@huawei.com> --- drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c index 76bf754..f77d227 100644 --- a/drivers/net/virtio/virtio_user/vhost_kernel_tap.c +++ b/drivers/net/virtio/virtio_user/vhost_kernel_tap.c @@ -131,7 +131,8 @@ goto error; } - vhost_kernel_tap_set_offload(tapfd, features); + if (vhost_kernel_tap_set_offload(tapfd, features) < 0) + goto error; memset(&ifr, 0, sizeof(ifr)); ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; -- 1.8.3.1