vhost: fix potential null pointer dereference
PATCH 1/1 vhost: fix potential null pointer dereference
Coverity issue: 293097
Fixes d90cf7d111ac ("vhost: support host notifier")
Signed-off-by Tiwei Bie <[email protected]>
--- lib/librte_vhost/vhost_user.c | 2 ++ 1 file changed, 2 insertions(+)
lib/librte_vhost/vhost_user.c +2 -0
@@ -1830,6 +1830,8 @@ int vhost_user_host_notifier_ctrl(int vid, bool enable)return -ENOTSUP ; vdpa_dev =rte_vdpa_get_device (did); +if (!vdpa_dev) +return -ENODEV ;RTE_FUNC_PTR_OR_ERR_RET (vdpa_dev->ops->get_vfio_device_fd, -ENOTSUP );RTE_FUNC_PTR_OR_ERR_RET (vdpa_dev->ops->get_notify_area, -ENOTSUP );
Signature · 1 line
2.17.0
Quoted 14 lines · Tiwei Bie
Coverity issue: 293097
Fixes d90cf7d111ac ("vhost: support host notifier")Signed-off-by Tiwei Bie <[email protected]>--- lib/librte_vhost/vhost_user.c | 2 ++ 1 file changed, 2 insertions(+)lib/librte_vhost/vhost_user.c +0
-0
lib/librte_vhost/vhost_user.c int vhost_user_host_notifier_ctrl(int vid, bool enable) · line 1837
Quoted 8 lines
lib/librte_vhost/vhost_user.c +2
-0@@ -1830,6 +1830,8 @@ int vhost_user_host_notifier_ctrl(int vid, bool enable)return -ENOTSUP ; vdpa_dev =rte_vdpa_get_device (did); +if (!vdpa_dev) +return -ENODEV ;RTE_FUNC_PTR_OR_ERR_RET (vdpa_dev->ops->get_vfio_device_fd, -ENOTSUP );RTE_FUNC_PTR_OR_ERR_RET (vdpa_dev->ops->get_notify_area, -ENOTSUP );
Reviewed-by Maxime Coquelin <[email protected]>
Thanks,
Maxime
Maxime Coquelin
AppliedQuoted 7 lines · Tiwei Bie
Coverity issue: 293097
Fixes d90cf7d111ac ("vhost: support host notifier")Signed-off-by Tiwei Bie<[email protected]>--- lib/librte_vhost/vhost_user.c | 2 ++ 1 file changed, 2 insertions(+)
Applied to dpdk-next-virtio/master.
Thanks,
Maxime