From: Jesper Juhl Date: Tue, 7 Aug 2012 22:07:03 +0000 (+0200) Subject: doc: aliasing-test: close fd on write error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5ffd27fa8d7950a3c2136100860273e6ff2605e0;p=linux-beck.git doc: aliasing-test: close fd on write error If write fails, remember to close(fd) before returning. Signed-off-by: Jesper Juhl Signed-off-by: Jiri Kosina --- diff --git a/Documentation/ia64/aliasing-test.c b/Documentation/ia64/aliasing-test.c index 5caa2af33207..62a190d45f38 100644 --- a/Documentation/ia64/aliasing-test.c +++ b/Documentation/ia64/aliasing-test.c @@ -132,6 +132,7 @@ static int read_rom(char *path) rc = write(fd, "1", 2); if (rc <= 0) { + close(fd); perror("write"); return -1; }