|
@@ -1309,7 +1309,6 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
|
|
|
struct cmd_ctrl_node *cmd_node;
|
|
|
union mwifiex_scan_cmd_config_tlv *scan_cfg_out;
|
|
|
struct mwifiex_ie_types_chan_list_param_set *chan_list_out;
|
|
|
- u32 buf_size;
|
|
|
struct mwifiex_chan_scan_param_set *scan_chan_list;
|
|
|
u8 filtered_scan;
|
|
|
u8 scan_current_chan_only;
|
|
@@ -1332,18 +1331,16 @@ int mwifiex_scan_networks(struct mwifiex_private *priv,
|
|
|
spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
|
|
|
|
|
|
scan_cfg_out = kzalloc(sizeof(union mwifiex_scan_cmd_config_tlv),
|
|
|
- GFP_KERNEL);
|
|
|
+ GFP_KERNEL);
|
|
|
if (!scan_cfg_out) {
|
|
|
- dev_err(adapter->dev, "failed to alloc scan_cfg_out\n");
|
|
|
ret = -ENOMEM;
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
- buf_size = sizeof(struct mwifiex_chan_scan_param_set) *
|
|
|
- MWIFIEX_USER_SCAN_CHAN_MAX;
|
|
|
- scan_chan_list = kzalloc(buf_size, GFP_KERNEL);
|
|
|
+ scan_chan_list = kcalloc(MWIFIEX_USER_SCAN_CHAN_MAX,
|
|
|
+ sizeof(struct mwifiex_chan_scan_param_set),
|
|
|
+ GFP_KERNEL);
|
|
|
if (!scan_chan_list) {
|
|
|
- dev_err(adapter->dev, "failed to alloc scan_chan_list\n");
|
|
|
kfree(scan_cfg_out);
|
|
|
ret = -ENOMEM;
|
|
|
goto done;
|
|
@@ -1461,12 +1458,9 @@ static int mwifiex_update_curr_bss_params(struct mwifiex_private *priv,
|
|
|
unsigned long flags;
|
|
|
|
|
|
/* Allocate and fill new bss descriptor */
|
|
|
- bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor),
|
|
|
- GFP_KERNEL);
|
|
|
- if (!bss_desc) {
|
|
|
- dev_err(priv->adapter->dev, " failed to alloc bss_desc\n");
|
|
|
+ bss_desc = kzalloc(sizeof(struct mwifiex_bssdescriptor), GFP_KERNEL);
|
|
|
+ if (!bss_desc)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
|
|
|
ret = mwifiex_fill_new_bss_desc(priv, bss, bss_desc);
|
|
|
if (ret)
|
|
@@ -1879,10 +1873,8 @@ static int mwifiex_scan_specific_ssid(struct mwifiex_private *priv,
|
|
|
}
|
|
|
|
|
|
scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg), GFP_KERNEL);
|
|
|
- if (!scan_cfg) {
|
|
|
- dev_err(adapter->dev, "failed to alloc scan_cfg\n");
|
|
|
+ if (!scan_cfg)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
|
|
|
scan_cfg->ssid_list = req_ssid;
|
|
|
scan_cfg->num_ssids = 1;
|
|
@@ -1996,11 +1988,8 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv)
|
|
|
kfree(priv->curr_bcn_buf);
|
|
|
priv->curr_bcn_buf = kmalloc(curr_bss->beacon_buf_size,
|
|
|
GFP_ATOMIC);
|
|
|
- if (!priv->curr_bcn_buf) {
|
|
|
- dev_err(priv->adapter->dev,
|
|
|
- "failed to alloc curr_bcn_buf\n");
|
|
|
+ if (!priv->curr_bcn_buf)
|
|
|
return;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf,
|