DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio-user: fix return value of tap offload sets not checked
@ 2019-12-16  1:03 Yunjian Wang
  2019-12-16  5:51 ` Tiwei Bie
  0 siblings, 1 reply; 2+ messages in thread
From: Yunjian Wang @ 2019-12-16  1:03 UTC (permalink / raw)
  To: dev
  Cc: maxime.coquelin, tiwei.bie, zhihong.wang, xudingke, Yunjian Wang, stable

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: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-16  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16  1:03 [dpdk-dev] [PATCH] net/virtio-user: fix return value of tap offload sets not checked Yunjian Wang
2019-12-16  5:51 ` Tiwei Bie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).