Skip to contentSkip to conversation

ath10k: do not return invalid pointers as a *dentry

PATCH In review Greg Kroah-Hartman 2 participants 3 messages Jan 31, 2019 – Feb 7, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/wireless/ath/ath10k/spectral.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath10k/spectral.c +3 -0
index 653b6d013207..4a7fa3e4e99f 100644
@@ -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;
 }
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · Greg Kroah-Hartman

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.

Quoted 6 lines

Patch applied to ath-next branch of ath.git, thanks.

0b38b4b44516 ath10k: do not return invalid pointers as a *dentry

Signature · 3 lines
https://patchwork.kernel.org/patch/10790493/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Greg Kroah-Hartman
Quoted 7 lines · Greg Kroah-Hartman

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.

Quoted 6 lines

Patch applied to ath-next branch of ath.git, thanks.

0b38b4b44516 ath10k: do not return invalid pointers as a *dentry

Signature · 9 lines
https://patchwork.kernel.org/patch/10790493/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k