[ovs-dev] [PATCH 27/40] datapath-windows: Add assert in OvsPartialCopyNBL

Shashank Ram rams at vmware.com
Fri Jul 14 17:09:16 UTC 2017


________________________________________
From: ovs-dev-bounces at openvswitch.org <ovs-dev-bounces at openvswitch.org> on behalf of Alin Serdean <aserdean at cloudbasesolutions.com>
Sent: Thursday, July 13, 2017 9:40 PM
To: dev at openvswitch.org
Subject: [ovs-dev] [PATCH 27/40] datapath-windows: Add assert in        OvsPartialCopyNBL

`srcNb` should never be NULL since it was copied over from another nbl.
Add an assertion just in case and to keep static analysis happy.

Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
 datapath-windows/ovsext/BufferMgmt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c
index 53490fa..c81ca2a 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -802,6 +802,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
              OVS_BUFFER_PRIVATE_FORWARD_CONTEXT;

     srcNb = NET_BUFFER_LIST_FIRST_NB(nbl);
+    ASSERT(srcNb);
     OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize,
                       OVS_DPPORT_NUMBER_INVALID);

--
2.10.2.windows.1
_______________________________________________

Acked-by: Shashank Ram <rams at vmware.com>


More information about the dev mailing list