Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[~shefty/rdma-dev.git] / drivers / net / wireless / mwifiex / scan.c
index db4d5ae3ff9679570b246295aa4d1cf0bc065d5a..bb60c2754a97ea54cc8c709206ba31a861e05d2e 100644 (file)
@@ -1334,7 +1334,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;
@@ -1357,18 +1356,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;
@@ -1486,12 +1483,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)
@@ -1911,10 +1905,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;
@@ -2028,11 +2020,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,