[PATCH] modinfo: Fix segmentation fault due to the wrong parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



modinfo segfaults when called with a module which is just deleted from
the filesystem without re-running depmod.

Pass filename instead of the address of it to the error() function to
fix the problem.

Tested-by: Ozan Çağlayan <ozan@xxxxxxxxxxxxx>
Signed-off-by: Ozan Çağlayan <ozan@xxxxxxxxxxxxx>
---
 modinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modinfo.c b/modinfo.c
index 1c1b57e..c2d733f 100644
--- a/modinfo.c
+++ b/modinfo.c
@@ -242,7 +242,7 @@ static struct elf_file *grab_module(const char *name,
 			module = grab_elf_file(filename);
 			if (!module)
 				error("modinfo: could not open %s: %s\n",
-					*filename, strerror(errno));
+					 filename, strerror(errno));
 			free(filename);
 			return module;
 		}
-- 
1.6.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux