Commit 0b38b4b4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Kalle Valo

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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent f9a4b7f4
...@@ -494,6 +494,9 @@ static struct dentry *create_buf_file_handler(const char *filename, ...@@ -494,6 +494,9 @@ static struct dentry *create_buf_file_handler(const char *filename,
buf_file = debugfs_create_file(filename, mode, parent, buf, buf_file = debugfs_create_file(filename, mode, parent, buf,
&relay_file_operations); &relay_file_operations);
if (IS_ERR(buf_file))
return NULL;
*is_global = 1; *is_global = 1;
return buf_file; return buf_file;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment