Code Review
/
vpp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
e4306b6
)
tap: fix the segv
49/29649/3
author
Mohsin Kazmi
<
[email protected]
>
Wed, 28 Oct 2020 18:35:53 +0000
(19:35 +0100)
committer
Damjan Marion
<
[email protected]
>
Thu, 29 Oct 2020 16:38:33 +0000
(16:38 +0000)
Type: fix
Change-Id: I53cb96950f8658d7159fb0bd8ecfa50b6977e5af
Signed-off-by: Mohsin Kazmi <
[email protected]
>
src/vnet/devices/tap/tap.c
patch
|
blob
|
history
diff --git
a/src/vnet/devices/tap/tap.c
b/src/vnet/devices/tap/tap.c
index
6ad0177
..
aa9182a
100644
(file)
--- a/
src/vnet/devices/tap/tap.c
+++ b/
src/vnet/devices/tap/tap.c
@@
-109,8
+109,11
@@
tap_free (vlib_main_t * vm, virtio_if_t * vif)
virtio_vring_free_tx (vm, vif, TX_QUEUE (i));
/* *INDENT-ON* */
- _IOCTL (vif->tap_fds[0], TUNSETPERSIST, (void *) (uintptr_t) 0);
- tap_log_dbg (vif, "TUNSETPERSIST: unset");
+ if (vif->tap_fds)
+ {
+ _IOCTL (vif->tap_fds[0], TUNSETPERSIST, (void *) (uintptr_t) 0);
+ tap_log_dbg (vif, "TUNSETPERSIST: unset");
+ }
error:
vec_foreach_index (i, vif->tap_fds) close (vif->tap_fds[i]);