summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/linux-kernel-modules.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index c3569aa4..fa605bd8 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-20 Mark Wielaard <[email protected]>
+
+ * linux-kernel-modules.c (report_kernel_archive): Correct nested
+ asprintf result check for debug.a.
+
2013-12-18 Mark Wielaard <[email protected]>
* derelocate.c (__libdwfl_find_section_ndx): New internal function.
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index fe010282..53075183 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -1,5 +1,5 @@
/* Standard libdwfl callbacks for debugging the running Linux kernel.
- Copyright (C) 2005-2011 Red Hat, Inc.
+ Copyright (C) 2005-2011, 2013 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -251,9 +251,10 @@ report_kernel_archive (Dwfl *dwfl, const char **release,
return result;
char *archive;
- if (unlikely ((*release)[0] == '/'
- ? asprintf (&archive, "%s/debug.a", *release)
- : asprintf (&archive, MODULEDIRFMT "/debug.a", *release) < 0))
+ int res = (((*release)[0] == '/')
+ ? asprintf (&archive, "%s/debug.a", *release)
+ : asprintf (&archive, MODULEDIRFMT "/debug.a", *release));
+ if (unlikely (res < 0))
return ENOMEM;
int fd = try_kernel_name (dwfl, &archive, false);