git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e11411b
)
vhost: fix potential null pointer dereference
author
Tiwei Bie
<tiwei.bie@intel.com>
Fri, 22 Jun 2018 03:53:05 +0000
(11:53 +0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Mon, 2 Jul 2018 23:35:58 +0000
(
01:35
+0200)
Coverity issue: 293097
Fixes:
d90cf7d111ac
("vhost: support host notifier")
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
lib/librte_vhost/vhost_user.c
patch
|
blob
|
history
diff --git
a/lib/librte_vhost/vhost_user.c
b/lib/librte_vhost/vhost_user.c
index
26cfebe
..
bea6a04
100644
(file)
--- a/
lib/librte_vhost/vhost_user.c
+++ b/
lib/librte_vhost/vhost_user.c
@@
-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);