From: Jan Luebbe <jlu@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Jan Luebbe <jlu@pengutronix.de>
Subject: [ptxdist] [PATCH] libkmod: avoid calling syscall() with -1
Date: Thu, 2 May 2013 22:05:15 +0200 [thread overview]
Message-ID: <1367525115-24143-1-git-send-email-jlu@pengutronix.de> (raw)
In-Reply-To: <20130502195341.GA22668@pengutronix.de>
This fixes an illegal instruction error on qemu ARM.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
It seems this patch has been applied upstream:
http://thread.gmane.org/gmane.linux.kernel.modules/1061/focus=1064
...ssing-Don-t-call-syscall-with-syscallno-1.patch | 40 ++++++++++++++++++++
patches/kmod-13/series | 4 ++
2 files changed, 44 insertions(+)
create mode 100644 patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch
create mode 100644 patches/kmod-13/series
diff --git a/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch b/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch
new file mode 100644
index 0000000..a385d63
--- /dev/null
+++ b/patches/kmod-13/0001-missing-Don-t-call-syscall-with-syscallno-1.patch
@@ -0,0 +1,40 @@
+From: Lucas De Marchi <lucas.de.marchi@gmail.com>
+Date: Thu, 2 May 2013 13:22:57 -0300
+Subject: [PATCH] missing: Don't call syscall() with syscallno == -1
+
+Reported-by: Jean-Francis Roy <jeanfrancis@funtoo.org>
+Reported-by: Jan Luebbe <jlu@pengutronix.de>
+---
+ libkmod/missing.h | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/libkmod/missing.h b/libkmod/missing.h
+index edb88b9..b31af84 100644
+--- a/libkmod/missing.h
++++ b/libkmod/missing.h
+@@ -1,5 +1,6 @@
+ #pragma once
+
++#include <errno.h>
+ #include <unistd.h>
+ #include <sys/syscall.h>
+
+@@ -15,13 +16,14 @@
+ # define MODULE_INIT_IGNORE_VERMAGIC 2
+ #endif
+
+-#ifndef __NR_finit_module
+-# define __NR_finit_module -1
+-#endif
+-
+ #ifndef HAVE_FINIT_MODULE
+ static inline int finit_module(int fd, const char *uargs, int flags)
+ {
++#ifndef __NR_finit_module
++ errno = ENOSYS;
++ return -1;
++#else
+ return syscall(__NR_finit_module, fd, uargs, flags);
++#endif
+ }
+ #endif
diff --git a/patches/kmod-13/series b/patches/kmod-13/series
new file mode 100644
index 0000000..3fc301f
--- /dev/null
+++ b/patches/kmod-13/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-missing-Don-t-call-syscall-with-syscallno-1.patch
+# 0b7413dd7632441bc24225859a7d1866 - git-ptx-patches magic
--
1.7.10.4
--
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2013-05-02 20:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 14:54 Jan Luebbe
2013-05-02 19:53 ` Jan Luebbe
2013-05-02 20:05 ` Jan Luebbe [this message]
2013-05-03 16:58 ` Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1367525115-24143-1-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox