aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-30 10:32:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-30 10:32:18 +0100
commit722f4920646e1c42a2ac2a7fa0a7d8ccca935445 (patch)
tree33fe26ac95cc2d633a4946bf93c95c93a353acdf
parentee9dcf22a075bce42d85b58108ca601ca434e663 (diff)
downloadpatches-722f4920646e1c42a2ac2a7fa0a7d8ccca935445.tar.gz
iwlwifi patch
-rw-r--r--iwlwifi-properly-check-debugfs-dentry-before-using-it.patch42
-rw-r--r--series1
2 files changed, 43 insertions, 0 deletions
diff --git a/iwlwifi-properly-check-debugfs-dentry-before-using-it.patch b/iwlwifi-properly-check-debugfs-dentry-before-using-it.patch
new file mode 100644
index 00000000000000..916ecadddda1a7
--- /dev/null
+++ b/iwlwifi-properly-check-debugfs-dentry-before-using-it.patch
@@ -0,0 +1,42 @@
+From foo@baz Sat Mar 30 10:26:34 CET 2019
+Date: Sat, 30 Mar 2019 10:26:34 +0100
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Subject: [PATCH] iwlwifi: properly check debugfs dentry before using it
+
+debugfs can now report an error code if something went wrong instead of
+just NULL. So if the return value is to be used as a "real" dentry, it
+needs to be checked if it is an error before dereferencing it.
+
+This is now happening because of ff9fb72bc077 ("debugfs: return error
+values, not NULL"). If multiple iwlwifi devices are in the system, this
+can cause problems when the driver attempts to create the main debugfs
+directory again. Later on in the code we fail horribly by trying to
+dereference a pointer that is an error value.
+
+Reported-by: Laura Abbott <labbott@redhat.com>
+Cc: Johannes Berg <johannes.berg@intel.com>
+Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Cc: Luca Coelho <luciano.coelho@intel.com>
+Cc: Intel Linux Wireless <linuxwifi@intel.com>
+Cc: Kalle Valo <kvalo@codeaurora.org>
+Cc: stable <stable@vger.kernel.org> # 5.0
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
+@@ -774,8 +774,7 @@ void iwl_mvm_vif_dbgfs_register(struct i
+ return;
+
+ mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir);
+-
+- if (!mvmvif->dbgfs_dir) {
++ if (IS_ERR_OR_NULL(mvmvif->dbgfs_dir)) {
+ IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n",
+ dbgfs_dir);
+ return;
diff --git a/series b/series
index 7f0e9075c4dfe7..759319275b90db 100644
--- a/series
+++ b/series
@@ -1,5 +1,6 @@
#
+iwlwifi-properly-check-debugfs-dentry-before-using-it.patch
usb-usb.h-tweak-struct-urb-to-remove-wasted-space.patch
usb-cp210x-add-new-device-id.patch
0003-toneport-fixes.patch