Skip to content

Commit

Permalink
datapath-windows: Clean up properly in case of driver init failure.
Browse files Browse the repository at this point in the history
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
svinturis authored and blp committed Sep 1, 2015
1 parent 3a22387 commit 2cbf3e4
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions datapath-windows/ovsext/Driver.c
Expand Up @@ -139,18 +139,26 @@ DriverEntry(PDRIVER_OBJECT driverObject,
driverObject->DriverUnload = OvsExtUnload;

status = NdisFRegisterFilterDriver(driverObject,
(NDIS_HANDLE) gOvsExtDriverObject,
&driverChars, &gOvsExtDriverHandle);
(NDIS_HANDLE)gOvsExtDriverObject,
&driverChars,
&gOvsExtDriverHandle);
if (status != NDIS_STATUS_SUCCESS) {
return status;
goto cleanup;
}

/* Create the communication channel for usersapce. */
/* Create the communication channel for userspace. */
status = OvsCreateDeviceObject(gOvsExtDriverHandle);
if (status != NDIS_STATUS_SUCCESS) {
goto cleanup;
}

cleanup:
if (status != NDIS_STATUS_SUCCESS){
OvsCleanup();
NdisFDeregisterFilterDriver(gOvsExtDriverHandle);
gOvsExtDriverHandle = NULL;
if (gOvsExtDriverHandle) {
NdisFDeregisterFilterDriver(gOvsExtDriverHandle);
gOvsExtDriverHandle = NULL;
}
}

return status;
Expand Down

0 comments on commit 2cbf3e4

Please sign in to comment.