]> git.karo-electronics.de Git - linux-beck.git/commitdiff
doc: aliasing-test: close fd on write error
authorJesper Juhl <jj@chaosbits.net>
Tue, 7 Aug 2012 22:07:03 +0000 (00:07 +0200)
committerJiri Kosina <jkosina@suse.cz>
Sat, 1 Sep 2012 16:57:10 +0000 (09:57 -0700)
If write fails, remember to close(fd) before returning.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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;
        }