summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-power/acpi_call/acpi_call-1.2.1.ebuild2
-rw-r--r--sys-power/acpi_call/files/acpi_call-1.2.1-kernel-5.13.patch30
2 files changed, 32 insertions, 0 deletions
diff --git a/sys-power/acpi_call/acpi_call-1.2.1.ebuild b/sys-power/acpi_call/acpi_call-1.2.1.ebuild
index 90e2e0158a01..418c4c459dee 100644
--- a/sys-power/acpi_call/acpi_call-1.2.1.ebuild
+++ b/sys-power/acpi_call/acpi_call-1.2.1.ebuild
@@ -14,6 +14,8 @@ SLOT="0"
KEYWORDS="amd64"
IUSE="examples"
+PATCHES=( "${FILESDIR}/${P}-kernel-5.13.patch" )
+
BUILD_TARGETS="default"
CONFIG_CHECK="ACPI"
MODULE_NAMES="acpi_call(misc:${S})"
diff --git a/sys-power/acpi_call/files/acpi_call-1.2.1-kernel-5.13.patch b/sys-power/acpi_call/files/acpi_call-1.2.1-kernel-5.13.patch
new file mode 100644
index 000000000000..786e639c03ca
--- /dev/null
+++ b/sys-power/acpi_call/files/acpi_call-1.2.1-kernel-5.13.patch
@@ -0,0 +1,30 @@
+From 48011f82726c263f49a2b9ca3d9f674bdb4cfd22 Mon Sep 17 00:00:00 2001
+From: Alexander Wetzel <alexander@wetzel-home.de>
+Date: Thu, 8 Jul 2021 16:37:43 +0200
+Subject: [PATCH] Fix for 5.13+ kernels
+
+Upstream commit d4455faccd6c ('proc: mandate ->proc_lseek
+in "struct proc_ops"') made seek support for proc mandatory.
+
+Not providing it will cause a null pointer exception for kernels
+>=5.13.0
+
+Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
+---
+ acpi_call.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/acpi_call.c b/acpi_call.c
+index ebdda25..9fd9886 100644
+--- a/acpi_call.c
++++ b/acpi_call.c
+@@ -369,6 +369,9 @@ static ssize_t acpi_proc_read( struct file *filp, char __user *buff,
+ static struct proc_ops proc_acpi_operations = {
+ .proc_read = acpi_proc_read,
+ .proc_write = acpi_proc_write,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0)
++ .proc_lseek = default_llseek,
++#endif
+ };
+ #else
+ static struct file_operations proc_acpi_operations = {