Commit b25e77fd authored by Fariya Fatima's avatar Fariya Fatima Committed by John W. Linville

rsi: Potential null pointer derefernce issue fixed.

Signed-off-by: default avatarFariya Fatima <fariyaf@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ce7613db
...@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) ...@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter)
const struct rsi_dbg_files *files; const struct rsi_dbg_files *files;
dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL);
if (!dev_dbgfs)
return -ENOMEM;
adapter->dfsentry = dev_dbgfs; adapter->dfsentry = dev_dbgfs;
snprintf(devdir, sizeof(devdir), "%s", snprintf(devdir, sizeof(devdir), "%s",
wiphy_name(adapter->hw->wiphy)); wiphy_name(adapter->hw->wiphy));
dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
if (IS_ERR(dev_dbgfs->subdir)) { dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL);
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);
adapter->dfsentry = NULL; if (!dev_dbgfs->subdir) {
kfree(dev_dbgfs); kfree(dev_dbgfs);
return (int)PTR_ERR(dev_dbgfs->subdir); return -ENOMEM;
} else { }
for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
files = &dev_debugfs_files[ii]; for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
dev_dbgfs->rsi_files[ii] = files = &dev_debugfs_files[ii];
debugfs_create_file(files->name, dev_dbgfs->rsi_files[ii] =
files->perms, debugfs_create_file(files->name,
dev_dbgfs->subdir, files->perms,
common, dev_dbgfs->subdir,
&files->fops); common,
} &files->fops);
} }
return 0; return 0;
} }
......
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