From: Christian Lamparter Date: Tue, 10 Aug 2010 23:02:21 +0000 (+0200) Subject: carl9170 firmware: fix error code handling X-Git-Tag: 1.8.5~10 X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=commitdiff_plain;h=712e9bb023a8251ab32d15f6e46c4bf815ca91ab carl9170 firmware: fix error code handling Signed-off-by: Christian Lamparter --- diff --git a/tools/src/checksum.c b/tools/src/checksum.c index 7d1ae35..24f7036 100644 --- a/tools/src/checksum.c +++ b/tools/src/checksum.c @@ -54,8 +54,9 @@ int main(int argc, char *args[]) fw = carlfw_load(args[1]); if (IS_ERR_OR_NULL(fw)) { + err = PTR_ERR(fw); fprintf(stderr, "Failed to open file \"%s\" (%d).\n", - args[1], (int) PTR_ERR(fw)); + args[1], err); goto out; } diff --git a/tools/src/eeprom_fix.c b/tools/src/eeprom_fix.c index 7f28179..1786b87 100644 --- a/tools/src/eeprom_fix.c +++ b/tools/src/eeprom_fix.c @@ -275,8 +275,9 @@ int main(int argc, char *args[]) fw = carlfw_load(args[1]); if (IS_ERR_OR_NULL(fw)) { + err = PTR_ERR(fw); fprintf(stderr, "Failed to open file \"%s\" (%d).\n", - args[1], (int) PTR_ERR(fw)); + args[1], err); goto out; } diff --git a/tools/src/fwinfo.c b/tools/src/fwinfo.c index 3a1a583..5ef3334 100644 --- a/tools/src/fwinfo.c +++ b/tools/src/fwinfo.c @@ -245,8 +245,9 @@ int main(int argc, char *args[]) fw = carlfw_load(args[1]); if (IS_ERR_OR_NULL(fw)) { + err = PTR_ERR(fw); fprintf(stderr, "Failed to open firmware \"%s\" (%d).\n", - args[1], (int)PTR_ERR(fw)); + args[1], err); goto out; }