There are multiple `goto path_fail` with an open fd, but none that go to
`fail:` without going through `path_fail:` first, so let's just move the
`close(fd)` there.
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
goto path_fail;
cache->index_mmap_size = size;
- close(fd);
-
cache->size = (uint64_t *) cache->index_mmap;
cache->stored_keys = cache->index_mmap + sizeof(uint64_t);
path_fail:
+ if (fd != -1)
+ close(fd);
+
cache->driver_keys_blob_size = cv_size;
/* Create driver id keys */
return cache;
fail:
- if (fd != -1)
- close(fd);
if (cache)
ralloc_free(cache);
ralloc_free(local);