aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/ath10k-ct/patches
diff options
context:
space:
mode:
authorRobert Marko <robimarko@gmail.com>2021-11-29 12:46:54 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2021-11-29 21:48:03 +0100
commit040c02497c56c17d8cf04f9b8b535967d7c3b10e (patch)
tree14179d4b41207d1a801c9da013722ed4b3751efe /package/kernel/ath10k-ct/patches
parent22f85d63cf47450604c0256b332942e845b1079f (diff)
downloadupstream-040c02497c56c17d8cf04f9b8b535967d7c3b10e.tar.gz
upstream-040c02497c56c17d8cf04f9b8b535967d7c3b10e.tar.bz2
upstream-040c02497c56c17d8cf04f9b8b535967d7c3b10e.zip
ath10k-ct: Fix spectral scan NULL pointer
If spectral scan support is enabled then ath10k-ct will cause a NULL pointer due to relay_open() being called with a const callback struct which is only supported in kernel 5.11 and later. So, simply check the kernel version and if 5.11 and newer use the const callback struct, otherwise use the regular struct. Fixes: 553a3ac ("ath10k-ct: use 5.15 version") Signed-off-by: Robert Marko <robimarko@gmail.com>
Diffstat (limited to 'package/kernel/ath10k-ct/patches')
-rw-r--r--package/kernel/ath10k-ct/patches/300-ath10k-ct-Fix-spectral-scan-NULL-pointer.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/kernel/ath10k-ct/patches/300-ath10k-ct-Fix-spectral-scan-NULL-pointer.patch b/package/kernel/ath10k-ct/patches/300-ath10k-ct-Fix-spectral-scan-NULL-pointer.patch
new file mode 100644
index 0000000000..a3822a7e49
--- /dev/null
+++ b/package/kernel/ath10k-ct/patches/300-ath10k-ct-Fix-spectral-scan-NULL-pointer.patch
@@ -0,0 +1,32 @@
+From 0d2e335d780bda1432a9ba719c8200f796d27854 Mon Sep 17 00:00:00 2001
+From: Robert Marko <robimarko@gmail.com>
+Date: Mon, 29 Nov 2021 12:27:12 +0100
+Subject: [PATCH] ath10k-ct: Fix spectral scan NULL pointer
+
+If spectral scan support is enabled then ath10k-ct will cause a NULL
+pointer due to relay_open() being called with a const callback struct
+which is only supported in kernel 5.11 and later.
+
+So, simply check the kernel version and if 5.11 and newer use the const
+callback struct, otherwise use the regular struct.
+
+Fixes: 553a3ac ("ath10k-ct: use 5.15 version")
+Signed-off-by: Robert Marko <robimarko@gmail.com>
+---
+ ath10k-5.15/spectral.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/ath10k-5.15/spectral.c
++++ b/ath10k-5.15/spectral.c
+@@ -497,7 +497,11 @@ static int remove_buf_file_handler(struc
+ return 0;
+ }
+
++#if LINUX_VERSION_IS_GEQ(5,11,0)
+ static const struct rchan_callbacks rfs_spec_scan_cb = {
++#else
++static struct rchan_callbacks rfs_spec_scan_cb = {
++#endif
+ .create_buf_file = create_buf_file_handler,
+ .remove_buf_file = remove_buf_file_handler,
+ };