From: Roel Kluin Date: Tue, 22 Sep 2009 00:04:01 +0000 (-0700) Subject: arch/alpha/boot/tools/objstrip.c: wrong variable tested after open() X-Git-Tag: firefly_0821_release~12744 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=27258e448eb301cf89e351df87aa8cb916653bf2;p=firefly-linux-kernel-4.4.55.git arch/alpha/boot/tools/objstrip.c: wrong variable tested after open() The incorrect variable is tested. fd is used for another open() and is already tested. Signed-off-by: Roel Kluin Cc: Ivan Kokshaysky Cc: Richard Henderson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/alpha/boot/tools/objstrip.c b/arch/alpha/boot/tools/objstrip.c index ef1838230291..9d0727d18aee 100644 --- a/arch/alpha/boot/tools/objstrip.c +++ b/arch/alpha/boot/tools/objstrip.c @@ -93,7 +93,7 @@ main (int argc, char *argv[]) ofd = 1; if (i < argc) { ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666); - if (fd == -1) { + if (ofd == -1) { perror("open"); exit(1); }