From 712e9bb023a8251ab32d15f6e46c4bf815ca91ab Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Wed, 11 Aug 2010 01:02:21 +0200 Subject: [PATCH] carl9170 firmware: fix error code handling Signed-off-by: Christian Lamparter --- tools/src/checksum.c | 3 ++- tools/src/eeprom_fix.c | 3 ++- tools/src/fwinfo.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.31.1