doc: aliasing-test: close fd on write error
[firefly-linux-kernel-4.4.55.git] / Documentation / ia64 / aliasing-test.c
index 5caa2af33207917369c1cae917c07384ddc2837c..62a190d45f389335a9366f3240f5b214863eb838 100644 (file)
@@ -132,6 +132,7 @@ static int read_rom(char *path)
 
        rc = write(fd, "1", 2);
        if (rc <= 0) {
+               close(fd);
                perror("write");
                return -1;
        }