summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 14:16:25 +0100
committerKalle Valo <kvalo@codeaurora.org>2019-02-07 15:59:04 +0100
commitcd98625b3e3fd53b92323f781c0a80c039c23fbb (patch)
tree8c457af3760d075989c115636582e83fbb2dd770 /drivers/net/wireless/ath/ath9k
parentath10k: fill tx_duration for each peer in Tx stats per STA (diff)
downloadlinux-cd98625b3e3fd53b92323f781c0a80c039c23fbb.tar.xz
linux-cd98625b3e3fd53b92323f781c0a80c039c23fbb.zip
ath9k: do not return invalid pointers as a *dentry
When calling debugfs functions, they can now return error values if something went wrong. If that happens, return a NULL as a *dentry to the relay core instead of passing it an illegal pointer. The relay core should be able to handle an illegal pointer, but add this check to be safe. Cc: Kalle Valo <kvalo@codeaurora.org> Cc: QCA ath9k Development <ath9k-devel@qca.qualcomm.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/common-spectral.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c
index 6aa3ec024ffa..21191955a7c1 100644
--- a/drivers/net/wireless/ath/ath9k/common-spectral.c
+++ b/drivers/net/wireless/ath/ath9k/common-spectral.c
@@ -1039,6 +1039,9 @@ static struct dentry *create_buf_file_handler(const char *filename,
buf_file = debugfs_create_file(filename, mode, parent, buf,
&relay_file_operations);
+ if (IS_ERR(buf_file))
+ return NULL;
+
*is_global = 1;
return buf_file;
}