loader: Fix compilation warning in debug_report.c
authorMark Young <marky@lunarg.com>
Fri, 14 Oct 2016 20:18:56 +0000 (14:18 -0600)
committerMark Young <marky@lunarg.com>
Fri, 14 Oct 2016 21:27:28 +0000 (15:27 -0600)
Change-Id: I92e7f23217ef3897995514360c23849ef1cfadeb

loader/debug_report.c

index 637bfd5..4054d4e 100644 (file)
@@ -386,7 +386,7 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback(
 out:
 
     // Roll back on errors
-    if (res != NULL) {
+    if (VK_SUCCESS != res) {
         storage_idx = 0;
         for (icd = inst->icds; icd; icd = icd->next) {
             if (NULL == icd->DestroyDebugReportCallbackEXT) {
@@ -419,12 +419,9 @@ out:
                 free(icd_info);
             }
         }
-
-        return res;
     }
 
-
-    return VK_SUCCESS;
+    return res;
 }
 
 /*