summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 14:15:56 +0100
committerKalle Valo <kvalo@codeaurora.org>2019-02-07 16:55:12 +0200
commit0b38b4b44516add3d1e3062a08fdcf1856476a00 (patch)
treeb3b01707784718aa5a8cd7489cb557a3d0dba246 /drivers
parentf9a4b7f45ff595e33c98d652e852854818fddad7 (diff)
downloadlinux-0b38b4b44516add3d1e3062a08fdcf1856476a00.tar.bz2
ath10k: 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: ath10k@lists.infradead.org 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')
-rw-r--r--drivers/net/wireless/ath/ath10k/spectral.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/spectral.c b/drivers/net/wireless/ath/ath10k/spectral.c
index 653b6d013207..4a7fa3e4e99f 100644
--- a/drivers/net/wireless/ath/ath10k/spectral.c
+++ b/drivers/net/wireless/ath/ath10k/spectral.c
@@ -494,6 +494,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;
}