summaryrefslogtreecommitdiff
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorFariya Fatima <fariyaf@gmail.com>2014-04-02 09:29:50 +0530
committerJohn W. Linville <linville@tuxdriver.com>2014-04-09 13:55:53 -0400
commitb25e77fdfa9510a7d47b35ecddc16f5ea583ca4e (patch)
tree40aaa8331d939eae636f966d4d534ac319c34b3b /drivers/net/wireless
parentce7613db2d8d4d5af2587ab5d7090055c4562201 (diff)
rsi: Potential null pointer derefernce issue fixed.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_debugfs.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
index 7e4ef4554411..c466246a323f 100644
--- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c
+++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter)
const struct rsi_dbg_files *files;
dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL);
+ if (!dev_dbgfs)
+ return -ENOMEM;
+
adapter->dfsentry = dev_dbgfs;
snprintf(devdir, sizeof(devdir), "%s",
wiphy_name(adapter->hw->wiphy));
- dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
- if (IS_ERR(dev_dbgfs->subdir)) {
- if (dev_dbgfs->subdir == ERR_PTR(-ENODEV))
- rsi_dbg(ERR_ZONE,
- "%s:Debugfs has not been mounted\n", __func__);
- else
- rsi_dbg(ERR_ZONE, "debugfs:%s not created\n", devdir);
+ dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
- adapter->dfsentry = NULL;
+ if (!dev_dbgfs->subdir) {
kfree(dev_dbgfs);
- return (int)PTR_ERR(dev_dbgfs->subdir);
- } else {
- for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
- files = &dev_debugfs_files[ii];
- dev_dbgfs->rsi_files[ii] =
- debugfs_create_file(files->name,
- files->perms,
- dev_dbgfs->subdir,
- common,
- &files->fops);
- }
+ return -ENOMEM;
+ }
+
+ for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
+ files = &dev_debugfs_files[ii];
+ dev_dbgfs->rsi_files[ii] =
+ debugfs_create_file(files->name,
+ files->perms,
+ dev_dbgfs->subdir,
+ common,
+ &files->fops);
}
return 0;
}