diff --git a/libraries/AP_HAL_Linux/Storage.cpp b/libraries/AP_HAL_Linux/Storage.cpp index fe4641e082..7d3a460b62 100644 --- a/libraries/AP_HAL_Linux/Storage.cpp +++ b/libraries/AP_HAL_Linux/Storage.cpp @@ -104,8 +104,6 @@ int Storage::_storage_create(const char *dpath) unlinkat(dfd, dpath, 0); int fd = openat(dfd, STORAGE_FILE, O_RDWR|O_CREAT|O_CLOEXEC, 0666); - close(dfd); - if (fd == -1) { fprintf(stderr, "Failed to create storage file %s/%s\n", dpath, STORAGE_FILE);