Message ID | 20200523122828.54627-1-xiangxia.m.yue@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev,1/2] dpif-netdev: Add check mark to avoid ovs-vswitchd crash. | expand |
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 46eb1e3d97c9..25c4b960857a 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2265,6 +2265,13 @@ mark_to_flow_disassociate(struct dp_netdev_pmd_thread *pmd, uint32_t mark = flow->mark; struct cmap_node *mark_node = CONST_CAST(struct cmap_node *, &flow->mark_node); + /* Check the mark if avoidable, INVALID_FLOW_MARK may + * mean that the flow has been disassociated or never + * associated. + */ + if (OVS_UNLIKELY(mark == INVALID_FLOW_MARK)) { + return -1; + } cmap_remove(&flow_mark.mark_to_flow, mark_node, hash_int(mark, 0)); flow->mark = INVALID_FLOW_MARK;