diff mbox

[ovs-dev,05/40] datapath-windows: Fix possible NULL dereference in IpFragment

Message ID 20170714044033.15196-6-aserdean@cloudbasesolutions.com
State Accepted
Headers show

Commit Message

Alin Serdean July 14, 2017, 4:40 a.m. UTC
If we can't allocate the NBL just return.

Found using WDK 10 static code analysis.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
 datapath-windows/ovsext/IpFragment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/datapath-windows/ovsext/IpFragment.c b/datapath-windows/ovsext/IpFragment.c
index e601a15..eb278ef 100644
--- a/datapath-windows/ovsext/IpFragment.c
+++ b/datapath-windows/ovsext/IpFragment.c
@@ -205,7 +205,7 @@  OvsIpv4Reassemble(POVS_SWITCH_CONTEXT switchContext,
     *newNbl = OvsAllocateNBLFromBuffer(switchContext, packetBuf, packetLen);
     if (*newNbl == NULL) {
         OVS_LOG_ERROR("Insufficient resources, failed to allocate newNbl");
-        status = NDIS_STATUS_RESOURCES;
+        return NDIS_STATUS_RESOURCES;
     }
 
     /* Complete the fragment NBL */