diff options
author | Alin Serdean <aserdean@cloudbasesolutions.com> | 2017-11-06 17:33:38 +0200 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2017-11-29 16:51:17 +0200 |
commit | 7d20979a88b37c580346d278663cde0d4c78dae9 (patch) | |
tree | 0541185b60ebfc395a79fb710ff6d3c39e354b30 | |
parent | 263e428e152d56eba2d04e6429dfcb8477146f9c (diff) | |
download | openvswitch-7d20979a88b37c580346d278663cde0d4c78dae9.tar.gz |
datapath-windows: Fix static analysis warnings around ovsInstanceListLock
Check for return value when trying to initialize ovsInstanceListLock.
Also return the status back to caller of `OvsInitIpHelper`.
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Shashank Ram <shashank08@gmail.com>
-rw-r--r-- | datapath-windows/ovsext/IpHelper.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/datapath-windows/ovsext/IpHelper.c b/datapath-windows/ovsext/IpHelper.c index e995e56ae..6bbd096c5 100644 --- a/datapath-windows/ovsext/IpHelper.c +++ b/datapath-windows/ovsext/IpHelper.c @@ -1989,6 +1989,12 @@ OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle) HANDLE threadHandle; UINT32 i; + status = ExInitializeResourceLite(&ovsInstanceListLock); + if (status != NDIS_STATUS_SUCCESS) { + return status; + } + InitializeListHead(&ovsInstanceList); + ovsFwdHashTable = (PLIST_ENTRY)OvsAllocateMemoryWithTag( sizeof(LIST_ENTRY) * OVS_FWD_HASH_TABLE_SIZE, OVS_IPHELPER_POOL_TAG); @@ -2009,9 +2015,6 @@ OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle) ipRouteNotificationHandle = NULL; unicastIPNotificationHandle = NULL; - ExInitializeResourceLite(&ovsInstanceListLock); - InitializeListHead(&ovsInstanceList); - if (ovsFwdHashTable == NULL || ovsRouteHashTable == NULL || ovsNeighHashTable == NULL || @@ -2074,7 +2077,7 @@ init_cleanup: ExDeleteResourceLite(&ovsInstanceListLock); NdisFreeSpinLock(&ovsIpHelperLock); } - return STATUS_SUCCESS; + return status; } |