diff mbox

[ovs-dev,34/40] datapath-windows: Vport check RtlStringCbLengthW return value

Message ID BY2PR0501MB211928662FF1E8498D9F4117A2AD0@BY2PR0501MB2119.namprd05.prod.outlook.com
State Not Applicable
Headers show

Commit Message

Shashank Ram July 14, 2017, 5:30 p.m. UTC
Minor nit inline.
diff mbox

Patch

diff --git a/datapath-windows/ovsext/Vport.c b/datapath-windows/ovsext/Vport.c
index 075f419..071bc31 100644
--- a/datapath-windows/ovsext/Vport.c
+++ b/datapath-windows/ovsext/Vport.c
@@ -1144,8 +1144,13 @@  GetNICAlias(PNDIS_SWITCH_NIC_PARAMETERS nicParam,
         if (status == STATUS_SUCCESS) {
             RtlStringCbPrintfW(portFriendlyName->String,
                                IF_MAX_STRING_SIZE, L"%s", interfaceName);
-            RtlStringCbLengthW(portFriendlyName->String, IF_MAX_STRING_SIZE,
-                               &len);
+            status = RtlStringCbLengthW(portFriendlyName->String,
+                                        IF_MAX_STRING_SIZE, &len);
+            if (!NT_SUCCESS(status)) {
+                OVS_LOG_ERROR("Fail to get the length of the string,"
+                              "status: %x", status);
>> s/Fail/Failed

+                return status;
+            }
             portFriendlyName->Length = (USHORT)len;