mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-13 01:04:35 +08:00
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>
This commit is contained in:
parent
056550291d
commit
cd98625b3e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user