wireless: Remove unnecessary alloc/OOM messages, alloc cleanups
authorJoe Perches <joe@perches.com>
Sun, 3 Feb 2013 17:28:14 +0000 (17:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Feb 2013 18:22:34 +0000 (13:22 -0500)
alloc failures already get standardized OOM
messages and a dump_stack.

Convert kzalloc's with multiplies to kcalloc.
Convert kmalloc's with multiplies to kmalloc_array.
Remove now unused variables.
Remove unnecessary memset after kzalloc->kcalloc.
Whitespace cleanups for these changes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
22 files changed:
drivers/net/wireless/airo_cs.c
drivers/net/wireless/at76c50x-usb.c
drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c
drivers/net/wireless/atmel_cs.c
drivers/net/wireless/ipw2x00/ipw2100.c
drivers/net/wireless/libertas/cfg.c
drivers/net/wireless/mwifiex/11n.c
drivers/net/wireless/mwifiex/11n_rxreorder.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/init.c
drivers/net/wireless/mwifiex/scan.c
drivers/net/wireless/mwifiex/sdio.c
drivers/net/wireless/mwifiex/sta_ioctl.c
drivers/net/wireless/mwifiex/wmm.c
drivers/net/wireless/orinoco/main.c
drivers/net/wireless/p54/p54usb.c
drivers/net/wireless/prism54/islpci_mgt.c
drivers/net/wireless/rndis_wlan.c
drivers/net/wireless/ti/wlcore/sdio.c
drivers/net/wireless/ti/wlcore/spi.c
drivers/net/wireless/zd1211rw/zd_usb.c

index 630577dd3a7add9166ef8668797cd38076f58b9e..956024a636e6d7868b2ddea67ee7efd0b8857816 100644 (file)
@@ -69,10 +69,9 @@ static int airo_probe(struct pcmcia_device *p_dev)
 
        /* Allocate space for private device-specific data */
        local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
-       if (!local) {
-               printk(KERN_ERR "airo_cs: no memory for new device\n");
+       if (!local)
                return -ENOMEM;
-       }
+
        p_dev->priv = local;
 
        return airo_config(p_dev);
index 77fa4286e5e98d2034fcbda6c0d786c3b455c50e..5ac5f7ae2721a2e8db91536a10ed94b6116960af 100644 (file)
@@ -2164,10 +2164,8 @@ static int at76_alloc_urbs(struct at76_priv *priv,
 
        buffer_size = sizeof(struct at76_tx_buffer) + MAX_PADDING_SIZE;
        priv->bulk_out_buffer = kmalloc(buffer_size, GFP_KERNEL);
-       if (!priv->bulk_out_buffer) {
-               dev_err(&interface->dev, "cannot allocate output buffer\n");
+       if (!priv->bulk_out_buffer)
                return -ENOMEM;
-       }
 
        at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __func__);
 
index 24877b00cbf4b7b97a534daaf1cc0316d8928e8c..467b60014b7b73720b25440c584ae9a49c968bcc 100644 (file)
@@ -288,11 +288,11 @@ struct dfs_pattern_detector *
 dfs_pattern_detector_init(enum nl80211_dfs_regions region)
 {
        struct dfs_pattern_detector *dpd;
+
        dpd = kmalloc(sizeof(*dpd), GFP_KERNEL);
-       if (dpd == NULL) {
-               pr_err("allocation of dfs_pattern_detector failed\n");
+       if (dpd == NULL)
                return NULL;
-       }
+
        *dpd = default_dpd;
        INIT_LIST_HEAD(&dpd->channel_detectors);
 
index ded03d226a7108cab5f8bf698747000fa364e5c4..b42930f457c2cca4439da479b1ed162ee3e7106b 100644 (file)
@@ -79,10 +79,9 @@ static int atmel_probe(struct pcmcia_device *p_dev)
 
        /* Allocate space for private device-specific data */
        local = kzalloc(sizeof(local_info_t), GFP_KERNEL);
-       if (!local) {
-               printk(KERN_ERR "atmel_cs: no memory for new device\n");
+       if (!local)
                return -ENOMEM;
-       }
+
        p_dev->priv = local;
 
        return atmel_config(p_dev);
index d92b21a8e5977c19b528dfe9038d23aec96f708c..04d5e6442bf668e5bd8ddfd9fac8b9f7b4c1e36e 100644 (file)
@@ -4478,13 +4478,10 @@ static int ipw2100_tx_allocate(struct ipw2100_priv *priv)
                return err;
        }
 
-       priv->tx_buffers =
-           kmalloc(TX_PENDED_QUEUE_LENGTH * sizeof(struct ipw2100_tx_packet),
-                   GFP_ATOMIC);
+       priv->tx_buffers = kmalloc_array(TX_PENDED_QUEUE_LENGTH,
+                                        sizeof(struct ipw2100_tx_packet),
+                                        GFP_ATOMIC);
        if (!priv->tx_buffers) {
-               printk(KERN_ERR DRV_NAME
-                      ": %s: alloc failed form tx buffers.\n",
-                      priv->net_dev->name);
                bd_queue_free(priv, &priv->tx_queue);
                return -ENOMEM;
        }
index 230f8ebbe28921f6786e250b4f88cb421c013385..a7dcb2e5eccc0120c0901fbf8b75b70650326f70 100644 (file)
@@ -2081,10 +2081,8 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev)
        lbs_deb_enter(LBS_DEB_CFG80211);
 
        wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
-       if (!wdev) {
-               dev_err(dev, "cannot allocate wireless device\n");
+       if (!wdev)
                return ERR_PTR(-ENOMEM);
-       }
 
        wdev->wiphy = wiphy_new(&lbs_cfg80211_ops, sizeof(struct lbs_private));
        if (!wdev->wiphy) {
index 9cd6216c61e6d802e140090b598f9f09e9d894c6..7b0ae2407083d6a873ac3bf38664bbaf666b6462 100644 (file)
@@ -533,11 +533,8 @@ void mwifiex_create_ba_tbl(struct mwifiex_private *priv, u8 *ra, int tid,
        if (!mwifiex_get_ba_tbl(priv, tid, ra)) {
                new_node = kzalloc(sizeof(struct mwifiex_tx_ba_stream_tbl),
                                   GFP_ATOMIC);
-               if (!new_node) {
-                       dev_err(priv->adapter->dev,
-                               "%s: failed to alloc new_node\n", __func__);
+               if (!new_node)
                        return;
-               }
 
                INIT_LIST_HEAD(&new_node->list);
 
index 4a97acd170f7bfcb423db64307a113c4c55f6852..5e796f8470885d6cf25eb9bbb678c7e8a4952174 100644 (file)
@@ -272,11 +272,8 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta,
        }
        /* if !tbl then create one */
        new_node = kzalloc(sizeof(struct mwifiex_rx_reorder_tbl), GFP_KERNEL);
-       if (!new_node) {
-               dev_err(priv->adapter->dev, "%s: failed to alloc new_node\n",
-                       __func__);
+       if (!new_node)
                return;
-       }
 
        INIT_LIST_HEAD(&new_node->list);
        new_node->tid = tid;
index ab92e799cf75fa4bb09b97b9e6642c07c733b911..8ba48192cd2fb937cbfe46807e1cea7c97487272 100644 (file)
@@ -1820,10 +1820,8 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy,
 
        priv->user_scan_cfg = kzalloc(sizeof(struct mwifiex_user_scan_cfg),
                                      GFP_KERNEL);
-       if (!priv->user_scan_cfg) {
-               dev_err(priv->adapter->dev, "failed to alloc scan_req\n");
+       if (!priv->user_scan_cfg)
                return -ENOMEM;
-       }
 
        priv->scan_request = request;
 
index 5f438e6c2155e6e8f103ae708791a1be2c1cedff..2b125beecf2c63e73083c92fd4722413d96b2fbe 100644 (file)
@@ -334,20 +334,15 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
 int mwifiex_alloc_cmd_buffer(struct mwifiex_adapter *adapter)
 {
        struct cmd_ctrl_node *cmd_array;
-       u32 buf_size;
        u32 i;
 
        /* Allocate and initialize struct cmd_ctrl_node */
-       buf_size = sizeof(struct cmd_ctrl_node) * MWIFIEX_NUM_OF_CMD_BUFFER;
-       cmd_array = kzalloc(buf_size, GFP_KERNEL);
-       if (!cmd_array) {
-               dev_err(adapter->dev, "%s: failed to alloc cmd_array\n",
-                       __func__);
+       cmd_array = kcalloc(MWIFIEX_NUM_OF_CMD_BUFFER,
+                           sizeof(struct cmd_ctrl_node), GFP_KERNEL);
+       if (!cmd_array)
                return -ENOMEM;
-       }
 
        adapter->cmd_pool = cmd_array;
-       memset(adapter->cmd_pool, 0, buf_size);
 
        /* Allocate and initialize command buffers */
        for (i = 0; i < MWIFIEX_NUM_OF_CMD_BUFFER; i++) {
index e00b8060aff7512228ef4de873a70f41a3e8219a..84848c33b7f094275bcbcca8b57680dab8db9e75 100644 (file)
@@ -39,11 +39,8 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
        unsigned long flags;
 
        bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL);
-       if (!bss_prio) {
-               dev_err(adapter->dev, "%s: failed to alloc bss_prio\n",
-                       __func__);
+       if (!bss_prio)
                return -ENOMEM;
-       }
 
        bss_prio->priv = priv;
        INIT_LIST_HEAD(&bss_prio->list);
index 9189a32b7844b713815636d03517e7532da31f94..f0de40166dc30395f580871b2d2e1f0c9a21e985 100644 (file)
@@ -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,
index 5a1c1d0e5599ab2689b8fee3d1e81d796dead8fc..31d7b2bdaa31e98de2b1a77c5c13e78d3f20cc58 100644 (file)
@@ -718,11 +718,8 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
 
        /* Assume that the allocated buffer is 8-byte aligned */
        fwbuf = kzalloc(MWIFIEX_UPLD_SIZE, GFP_KERNEL);
-       if (!fwbuf) {
-               dev_err(adapter->dev,
-                       "unable to alloc buffer for FW. Terminating dnld\n");
+       if (!fwbuf)
                return -ENOMEM;
-       }
 
        /* Perform firmware data transfer */
        do {
@@ -1520,7 +1517,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
 
        card->mpa_tx.buf = kzalloc(mpa_tx_buf_size, GFP_KERNEL);
        if (!card->mpa_tx.buf) {
-               dev_err(adapter->dev, "could not alloc buffer for MP-A TX\n");
                ret = -1;
                goto error;
        }
@@ -1529,7 +1525,6 @@ static int mwifiex_alloc_sdio_mpa_buffers(struct mwifiex_adapter *adapter,
 
        card->mpa_rx.buf = kzalloc(mpa_rx_buf_size, GFP_KERNEL);
        if (!card->mpa_rx.buf) {
-               dev_err(adapter->dev, "could not alloc buffer for MP-A RX\n");
                ret = -1;
                goto error;
        }
@@ -1682,10 +1677,8 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
 
        /* Allocate buffers for SDIO MP-A */
        card->mp_regs = kzalloc(MAX_MP_REGS, GFP_KERNEL);
-       if (!card->mp_regs) {
-               dev_err(adapter->dev, "failed to alloc mp_regs\n");
+       if (!card->mp_regs)
                return -ENOMEM;
-       }
 
        ret = mwifiex_alloc_sdio_mpa_buffers(adapter,
                                             SDIO_MP_TX_AGGR_DEF_BUF_SIZE,
index f542bb8ccbc8d4ce6859e8fff1e45784183f8fbb..b8fa76a2b953992c69c7141f31a50cf636ca0a09 100644 (file)
@@ -266,11 +266,9 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
 
                /* 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");
+                                  GFP_KERNEL);
+               if (!bss_desc)
                        return -ENOMEM;
-               }
 
                ret = mwifiex_fill_new_bss_desc(priv, bss, bss_desc);
                if (ret)
@@ -636,11 +634,8 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
                }
        }
        buf = kzalloc(MWIFIEX_SIZE_OF_CMD_BUFFER, GFP_KERNEL);
-       if (!buf) {
-               dev_err(priv->adapter->dev, "%s: failed to alloc cmd buffer\n",
-                       __func__);
+       if (!buf)
                return -ENOMEM;
-       }
 
        txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf;
        txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
index 135d96df2063a976ca107841b6d4f494abb1702a..32adc878041d252300c6fde9bd9d53ca049e902a 100644 (file)
@@ -109,12 +109,9 @@ mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter *adapter, u8 *ra)
        struct mwifiex_ra_list_tbl *ra_list;
 
        ra_list = kzalloc(sizeof(struct mwifiex_ra_list_tbl), GFP_ATOMIC);
-
-       if (!ra_list) {
-               dev_err(adapter->dev, "%s: failed to alloc ra_list\n",
-                       __func__);
+       if (!ra_list)
                return NULL;
-       }
+
        INIT_LIST_HEAD(&ra_list->list);
        skb_queue_head_init(&ra_list->skb_head);
 
index 1e802f82ae49ab746ee670d05f4ed56143f1d43b..38ec8d19ac29983ebb7f76e64b3193d011044a1d 100644 (file)
@@ -853,12 +853,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
        int err;
 
        desc = kmalloc(sizeof(*desc), GFP_ATOMIC);
-       if (!desc) {
-               printk(KERN_WARNING
-                      "%s: Can't allocate space for RX descriptor\n",
-                      dev->name);
+       if (!desc)
                goto update_stats;
-       }
 
        rxfid = hermes_read_regn(hw, RXFID);
 
@@ -1336,10 +1332,9 @@ static void qbuf_scan(struct orinoco_private *priv, void *buf,
        unsigned long flags;
 
        sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
-       if (!sd) {
-               printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+       if (!sd)
                return;
-       }
+
        sd->buf = buf;
        sd->len = len;
        sd->type = type;
@@ -1357,10 +1352,9 @@ static void qabort_scan(struct orinoco_private *priv)
        unsigned long flags;
 
        sd = kmalloc(sizeof(*sd), GFP_ATOMIC);
-       if (!sd) {
-               printk(KERN_ERR "%s: failed to alloc memory\n", __func__);
+       if (!sd)
                return;
-       }
+
        sd->len = -1; /* Abort */
 
        spin_lock_irqsave(&priv->scan_lock, flags);
index 800a16526c8ea548b17d67ab0f7d30a50b0cc327..62ac607375314ea2359bee774266897baa28b320 100644 (file)
@@ -510,11 +510,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
                return err;
 
        tmp = buf = kmalloc(P54U_FW_BLOCK, GFP_KERNEL);
-       if (!buf) {
-               dev_err(&priv->udev->dev, "(p54usb) cannot allocate firmware"
-                                         "upload buffer!\n");
+       if (!buf)
                return -ENOMEM;
-       }
 
        left = block_size = min((size_t)P54U_FW_BLOCK, priv->fw->size);
        strcpy(buf, p54u_firmware_upload_3887);
@@ -637,11 +634,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
        const u8 *data;
 
        buf = kmalloc(512, GFP_KERNEL);
-       if (!buf) {
-               dev_err(&priv->udev->dev, "(p54usb) firmware buffer "
-                                         "alloc failed!\n");
+       if (!buf)
                return -ENOMEM;
-       }
 
 #define P54U_WRITE(type, addr, data) \
        do {\
index c5404cb59e083d81ad04ca66a07cc18686b3c15b..9f19cceab487ae0fe8c720fa31077179a14f19f0 100644 (file)
@@ -123,11 +123,8 @@ islpci_mgmt_rx_fill(struct net_device *ndev)
 
                if (buf->mem == NULL) {
                        buf->mem = kmalloc(MGMT_FRAME_SIZE, GFP_ATOMIC);
-                       if (!buf->mem) {
-                               printk(KERN_WARNING
-                                      "Error allocating management frame.\n");
+                       if (!buf->mem)
                                return -ENOMEM;
-                       }
                        buf->size = MGMT_FRAME_SIZE;
                }
                if (buf->pci_addr == 0) {
@@ -356,14 +353,11 @@ islpci_mgt_receive(struct net_device *ndev)
 
                /* Determine frame size, skipping OID_INL_TUNNEL headers. */
                size = PIMFOR_HEADER_SIZE + header->length;
-               frame = kmalloc(sizeof (struct islpci_mgmtframe) + size,
+               frame = kmalloc(sizeof(struct islpci_mgmtframe) + size,
                                GFP_ATOMIC);
-               if (!frame) {
-                       printk(KERN_WARNING
-                              "%s: Out of memory, cannot handle oid 0x%08x\n",
-                              ndev->name, header->oid);
+               if (!frame)
                        continue;
-               }
+
                frame->ndev = ndev;
                memcpy(&frame->buf, header, size);
                frame->header = (pimfor_header_t *) frame->buf;
index abe1d039be814150d1815949e90f78b38573fa2d..9bb3f22b3669ef2e135358dc3221a8596ec07c37 100644 (file)
@@ -1621,11 +1621,8 @@ static void set_multicast_list(struct usbnet *usbdev)
        } else if (mc_count) {
                int i = 0;
 
-               mc_addrs = kmalloc(mc_count * ETH_ALEN, GFP_ATOMIC);
+               mc_addrs = kmalloc_array(mc_count, ETH_ALEN, GFP_ATOMIC);
                if (!mc_addrs) {
-                       netdev_warn(usbdev->net,
-                                   "couldn't alloc %d bytes of memory\n",
-                                   mc_count * ETH_ALEN);
                        netif_addr_unlock_bh(usbdev->net);
                        return;
                }
index 646f703ae739b3b84ebff7316aea31faf8fadfc2..a3a20be2036fda7548c87fe512cef0d4cb0829cd 100644 (file)
@@ -229,10 +229,8 @@ static int wl1271_probe(struct sdio_func *func,
                return -ENODEV;
 
        glue = kzalloc(sizeof(*glue), GFP_KERNEL);
-       if (!glue) {
-               dev_err(&func->dev, "can't allocate glue\n");
+       if (!glue)
                goto out;
-       }
 
        glue->dev = &func->dev;
 
index f06f4770ce029076b8e622fed5285b0167ef7aaa..18cadc07b754cb98628fe13cb6190a89009f2ed6 100644 (file)
@@ -87,11 +87,8 @@ static void wl12xx_spi_reset(struct device *child)
        struct spi_message m;
 
        cmd = kzalloc(WSPI_INIT_CMD_LEN, GFP_KERNEL);
-       if (!cmd) {
-               dev_err(child->parent,
-                       "could not allocate cmd for spi reset\n");
+       if (!cmd)
                return;
-       }
 
        memset(&t, 0, sizeof(t));
        spi_message_init(&m);
@@ -115,11 +112,8 @@ static void wl12xx_spi_init(struct device *child)
        struct spi_message m;
 
        cmd = kzalloc(WSPI_INIT_CMD_LEN, GFP_KERNEL);
-       if (!cmd) {
-               dev_err(child->parent,
-                       "could not allocate cmd for spi init\n");
+       if (!cmd)
                return;
-       }
 
        memset(crc, 0, sizeof(crc));
        memset(&t, 0, sizeof(t));
@@ -340,10 +334,8 @@ static int wl1271_probe(struct spi_device *spi)
        pdata->ops = &spi_ops;
 
        glue = kzalloc(sizeof(*glue), GFP_KERNEL);
-       if (!glue) {
-               dev_err(&spi->dev, "can't allocate glue\n");
+       if (!glue)
                goto out;
-       }
 
        glue->dev = &spi->dev;
 
index ef2b171e351479f5d9268a00e360d4e3ff525d1b..7ef0b4a181e130883a741c088fc9cb7668ddf231 100644 (file)
@@ -155,7 +155,6 @@ static int upload_code(struct usb_device *udev,
         */
        p = kmalloc(MAX_TRANSFER_SIZE, GFP_KERNEL);
        if (!p) {
-               dev_err(&udev->dev, "out of memory\n");
                r = -ENOMEM;
                goto error;
        }