Skip to content

Commit

Permalink
rsi: Potential null pointer derefernce issue fixed.
Browse files Browse the repository at this point in the history
Signed-off-by: Fariya Fatima <fariyaf@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Fariya Fatima authored and John W. Linville committed Apr 9, 2014
1 parent ce7613d commit b25e77f
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions drivers/net/wireless/rsi/rsi_91x_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b25e77f

Please sign in to comment.