projects
/
platform
/
upstream
/
kmod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03f7dfb
)
libkmod: Avoid calling syscall() with -1
author
Jan Luebbe
<jlu@pengutronix.de>
Thu, 2 May 2013 14:47:12 +0000
(16:47 +0200)
committer
Lucas De Marchi
<lucas.de.marchi@gmail.com>
Sat, 11 May 2013 03:54:15 +0000
(
00:54
-0300)
At least in qemu 1.4.1 for vexpress/arm-cortexa9, this resulted in an
illegal instruction error. Solve that by returning an error when
__NR_finit_module is -1.
libkmod/missing.h
patch
|
blob
|
history
diff --git
a/libkmod/missing.h
b/libkmod/missing.h
index
edb88b9
..
b45bbe2
100644
(file)
--- a/
libkmod/missing.h
+++ b/
libkmod/missing.h
@@
-20,8
+20,15
@@
#endif
#ifndef HAVE_FINIT_MODULE
+#include <errno.h>
+
static inline int finit_module(int fd, const char *uargs, int flags)
{
+ if (__NR_finit_module == -1) {
+ errno = ENOSYS;
+ return -1;
+ }
+
return syscall(__NR_finit_module, fd, uargs, flags);
}
#endif