diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index ed948dc59b3d..20db0eb636a8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -231,7 +231,7 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, | |||
231 | DECLARE_MAC_BUF(mac); | 231 | DECLARE_MAC_BUF(mac); |
232 | 232 | ||
233 | buf = kmalloc(bufsz, GFP_KERNEL); | 233 | buf = kmalloc(bufsz, GFP_KERNEL); |
234 | if(!buf) | 234 | if (!buf) |
235 | return -ENOMEM; | 235 | return -ENOMEM; |
236 | 236 | ||
237 | pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", | 237 | pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", |
@@ -364,16 +364,19 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
364 | { | 364 | { |
365 | struct iwl_debugfs *dbgfs; | 365 | struct iwl_debugfs *dbgfs; |
366 | struct dentry *phyd = priv->hw->wiphy->debugfsdir; | 366 | struct dentry *phyd = priv->hw->wiphy->debugfsdir; |
367 | int ret = 0; | ||
367 | 368 | ||
368 | dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL); | 369 | dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL); |
369 | if (!dbgfs) { | 370 | if (!dbgfs) { |
371 | ret = -ENOMEM; | ||
370 | goto err; | 372 | goto err; |
371 | } | 373 | } |
372 | 374 | ||
373 | priv->dbgfs = dbgfs; | 375 | priv->dbgfs = dbgfs; |
374 | dbgfs->name = name; | 376 | dbgfs->name = name; |
375 | dbgfs->dir_drv = debugfs_create_dir(name, phyd); | 377 | dbgfs->dir_drv = debugfs_create_dir(name, phyd); |
376 | if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)){ | 378 | if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)) { |
379 | ret = -ENOENT; | ||
377 | goto err; | 380 | goto err; |
378 | } | 381 | } |
379 | 382 | ||
@@ -394,7 +397,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
394 | err: | 397 | err: |
395 | IWL_ERROR("Can't open the debugfs directory\n"); | 398 | IWL_ERROR("Can't open the debugfs directory\n"); |
396 | iwl_dbgfs_unregister(priv); | 399 | iwl_dbgfs_unregister(priv); |
397 | return -ENOENT; | 400 | return ret; |
398 | } | 401 | } |
399 | EXPORT_SYMBOL(iwl_dbgfs_register); | 402 | EXPORT_SYMBOL(iwl_dbgfs_register); |
400 | 403 | ||
@@ -404,7 +407,7 @@ EXPORT_SYMBOL(iwl_dbgfs_register); | |||
404 | */ | 407 | */ |
405 | void iwl_dbgfs_unregister(struct iwl_priv *priv) | 408 | void iwl_dbgfs_unregister(struct iwl_priv *priv) |
406 | { | 409 | { |
407 | if (!(priv->dbgfs)) | 410 | if (!priv->dbgfs) |
408 | return; | 411 | return; |
409 | 412 | ||
410 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_eeprom); | 413 | DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_eeprom); |