Skip to contentSkip to conversation

rsi: no need to check return value of debugfs_create functions

PATCH In review Greg Kroah-Hartman 2 participants 2 messages Jan 22, 2019 – Feb 1, 2019 Redpine wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsi: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this.

---
 drivers/net/wireless/rsi/rsi_91x_debugfs.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/wireless/rsi/rsi_91x_debugfs.c +0 -5
index 8c6ca8e689e4..d0c35f3e2012 100644
@@ -297,11 +297,6 @@ int rsi_init_dbgfs(struct rsi_hw *adapter)
 
 	dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
 
-	if (!dev_dbgfs->subdir) {
-		kfree(dev_dbgfs);
-		return -ENOMEM;
-	}
-
 	for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
 		files = &dev_debugfs_files[ii];
 		dev_dbgfs->rsi_files[ii] =
Signature · 1 line
2.20.1
#1 lore raw
Quoted 7 lines · Greg Kroah-Hartman

When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this.

Patch applied to wireless-drivers-next.git, thanks.

b8f1fe518983 rsi: no need to check return value of debugfs_create functions

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

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