summaryrefslogtreecommitdiff
blob: 786e639c03cae007ec175a6eff91c10d67754192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 = {