rsi: Potential null pointer derefernce issue fixed.
Signed-off-by: Fariya Fatima <fariyaf@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Родитель
ce7613db2d
Коммит
b25e77fdfa
|
@ -289,23 +289,21 @@ 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);
|
||||
|
||||
adapter->dfsentry = NULL;
|
||||
if (!dev_dbgfs->subdir) {
|
||||
kfree(dev_dbgfs);
|
||||
return (int)PTR_ERR(dev_dbgfs->subdir);
|
||||
} else {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for (ii = 0; ii < adapter->num_debugfs_entries; ii++) {
|
||||
files = &dev_debugfs_files[ii];
|
||||
dev_dbgfs->rsi_files[ii] =
|
||||
|
@ -315,7 +313,6 @@ int rsi_init_dbgfs(struct rsi_hw *adapter)
|
|||
common,
|
||||
&files->fops);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rsi_init_dbgfs);
|
||||
|
|
Загрузка…
Ссылка в новой задаче