sahara: Avoid closing invalid fd

In the event that no ramdump_path is provided to sahara_run() the
ramdump_dir will remain -1. For good hygiene avoid calling close() on
this invalid file descriptor.

Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
This commit is contained in:
Bjorn Andersson
2024-12-13 13:08:24 -06:00
committed by Bjorn Andersson
parent 8adc9f3192
commit aa44721fe8

View File

@@ -492,7 +492,8 @@ int sahara_run(struct qdl_device *qdl, char *img_arr[], bool single_image,
}
}
close(ramdump_dir);
if (ramdump_dir >= 0)
close(ramdump_dir);
return done ? 0 : -1;
}