Commit 3428fc49 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed log after kzalloc()/kmalloc() failure

kzalloc/kmalloc already reports an allocation failure themselves.
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bb7410b2
...@@ -417,10 +417,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr) ...@@ -417,10 +417,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
struct brcmf_proto *cdc; struct brcmf_proto *cdc;
cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC); cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
if (!cdc) { if (!cdc)
brcmf_dbg(ERROR, "kmalloc failed\n");
goto fail; goto fail;
}
/* ensure that the msg buf directly follows the cdc msg struct */ /* ensure that the msg buf directly follows the cdc msg struct */
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) { if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
......
...@@ -562,10 +562,9 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable, ...@@ -562,10 +562,9 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
struct brcmf_pkt_filter_enable *pkt_filterp; struct brcmf_pkt_filter_enable *pkt_filterp;
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC); arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) { if (!arg_save)
brcmf_dbg(ERROR, "kmalloc failed\n");
goto fail; goto fail;
}
arg_org = arg_save; arg_org = arg_save;
memcpy(arg_save, arg, strlen(arg) + 1); memcpy(arg_save, arg, strlen(arg) + 1);
...@@ -635,18 +634,14 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg) ...@@ -635,18 +634,14 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
char *arg_save = NULL, *arg_org = NULL; char *arg_save = NULL, *arg_org = NULL;
arg_save = kstrdup(arg, GFP_ATOMIC); arg_save = kstrdup(arg, GFP_ATOMIC);
if (!arg_save) { if (!arg_save)
brcmf_dbg(ERROR, "kmalloc failed\n");
goto fail; goto fail;
}
arg_org = arg_save; arg_org = arg_save;
buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC); buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
if (!buf) { if (!buf)
brcmf_dbg(ERROR, "kmalloc failed\n");
goto fail; goto fail;
}
argv[i] = strsep(&arg_save, " "); argv[i] = strsep(&arg_save, " ");
while (argv[i++]) while (argv[i++])
......
...@@ -159,11 +159,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work) ...@@ -159,11 +159,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN); buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
bufp = buf = kmalloc(buflen, GFP_ATOMIC); bufp = buf = kmalloc(buflen, GFP_ATOMIC);
if (!bufp) { if (!bufp)
brcmf_dbg(ERROR, "%s: out of memory for mcast_list, cnt %d\n",
brcmf_ifname(&drvr_priv->pub, 0), cnt);
return; return;
}
strcpy(bufp, "mcast_list"); strcpy(bufp, "mcast_list");
bufp += strlen("mcast_list") + 1; bufp += strlen("mcast_list") + 1;
...@@ -202,11 +199,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work) ...@@ -202,11 +199,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
buflen = sizeof("allmulti") + sizeof(allmulti); buflen = sizeof("allmulti") + sizeof(allmulti);
buf = kmalloc(buflen, GFP_ATOMIC); buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) { if (!buf)
brcmf_dbg(ERROR, "%s: out of memory for allmulti\n",
brcmf_ifname(&drvr_priv->pub, 0));
return; return;
}
allmulti_le = cpu_to_le32(allmulti); allmulti_le = cpu_to_le32(allmulti);
if (!brcmu_mkiovar if (!brcmu_mkiovar
...@@ -963,11 +958,9 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net, ...@@ -963,11 +958,9 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net,
ifp = drvr_priv->iflist[ifidx]; ifp = drvr_priv->iflist[ifidx];
if (!ifp) { if (!ifp) {
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC); ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) { if (!ifp)
brcmf_dbg(ERROR, "OOM - struct brcmf_if\n");
return -ENOMEM; return -ENOMEM;
} }
}
memset(ifp, 0, sizeof(struct brcmf_if)); memset(ifp, 0, sizeof(struct brcmf_if));
ifp->info = drvr_priv; ifp->info = drvr_priv;
...@@ -1019,10 +1012,8 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen) ...@@ -1019,10 +1012,8 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
/* Allocate primary brcmf_info */ /* Allocate primary brcmf_info */
drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC); drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
if (!drvr_priv) { if (!drvr_priv)
brcmf_dbg(ERROR, "OOM - alloc brcmf_info\n");
goto fail; goto fail;
}
/* /*
* Save the brcmf_info into the priv * Save the brcmf_info into the priv
......
...@@ -2956,10 +2956,8 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus) ...@@ -2956,10 +2956,8 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
/* Get full mem size */ /* Get full mem size */
size = bus->ramsize; size = bus->ramsize;
buf = kmalloc(size, GFP_ATOMIC); buf = kmalloc(size, GFP_ATOMIC);
if (!buf) { if (!buf)
brcmf_dbg(ERROR, "Out of memory (%d bytes)\n", size);
return -1; return -1;
}
/* Read mem content */ /* Read mem content */
printk(KERN_DEBUG "Dump dongle memory"); printk(KERN_DEBUG "Dump dongle memory");
...@@ -3013,7 +3011,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size) ...@@ -3013,7 +3011,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
size = msize; size = msize;
mbuffer = data = kmalloc(msize, GFP_ATOMIC); mbuffer = data = kmalloc(msize, GFP_ATOMIC);
if (mbuffer == NULL) { if (mbuffer == NULL) {
brcmf_dbg(ERROR, "kmalloc(%d) failed\n", msize);
bcmerror = -ENOMEM; bcmerror = -ENOMEM;
goto done; goto done;
} }
...@@ -3021,7 +3018,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size) ...@@ -3021,7 +3018,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
str = kmalloc(maxstrlen, GFP_ATOMIC); str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) { if (str == NULL) {
brcmf_dbg(ERROR, "kmalloc(%d) failed\n", maxstrlen);
bcmerror = -ENOMEM; bcmerror = -ENOMEM;
goto done; goto done;
} }
...@@ -3737,8 +3733,6 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus) ...@@ -3737,8 +3733,6 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC); memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) { if (memblock == NULL) {
brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
MEMBLOCK);
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
} }
...@@ -3837,8 +3831,6 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus) ...@@ -3837,8 +3831,6 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
memblock = kmalloc(MEMBLOCK, GFP_ATOMIC); memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
if (memblock == NULL) { if (memblock == NULL) {
brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
MEMBLOCK);
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
} }
...@@ -4254,18 +4246,13 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus) ...@@ -4254,18 +4246,13 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus)
roundup((bus->drvr->maxctl + SDPCM_HDRLEN), roundup((bus->drvr->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + BRCMF_SDALIGN; ALIGNMENT) + BRCMF_SDALIGN;
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC); bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
if (!(bus->rxbuf)) { if (!(bus->rxbuf))
brcmf_dbg(ERROR, "kmalloc of %d-byte rxbuf failed\n",
bus->rxblen);
goto fail; goto fail;
} }
}
/* Allocate buffer to receive glomed packet */ /* Allocate buffer to receive glomed packet */
bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC); bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC);
if (!(bus->databuf)) { if (!(bus->databuf)) {
brcmf_dbg(ERROR, "kmalloc of %d-byte databuf failed\n",
MAX_DATA_BUF);
/* release rxbuf which was already located as above */ /* release rxbuf which was already located as above */
if (!bus->rxblen) if (!bus->rxblen)
kfree(bus->rxbuf); kfree(bus->rxbuf);
...@@ -4457,10 +4444,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs) ...@@ -4457,10 +4444,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
/* alloc chip_info_t */ /* alloc chip_info_t */
ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC); ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC);
if (NULL == ci) { if (NULL == ci)
brcmf_dbg(ERROR, "malloc failed!\n");
return -ENOMEM; return -ENOMEM;
}
/* bus/core/clk setup for register access */ /* bus/core/clk setup for register access */
/* Try forcing SDIO core to do ALPAvail request only */ /* Try forcing SDIO core to do ALPAvail request only */
...@@ -4785,10 +4770,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype, ...@@ -4785,10 +4770,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
/* Allocate private bus interface state */ /* Allocate private bus interface state */
bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC); bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
if (!bus) { if (!bus)
brcmf_dbg(ERROR, "kmalloc of struct dhd_bus failed\n");
goto fail; goto fail;
}
bus->sdiodev = sdiodev; bus->sdiodev = sdiodev;
sdiodev->bus = bus; sdiodev->bus = bus;
bus->txbound = BRCMF_TXBOUND; bus->txbound = BRCMF_TXBOUND;
......
...@@ -2023,7 +2023,6 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv, ...@@ -2023,7 +2023,6 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
WL_ERR("kzalloc() failed\n");
err = -ENOMEM; err = -ENOMEM;
goto CleanUp; goto CleanUp;
} }
...@@ -2660,10 +2659,9 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface, ...@@ -2660,10 +2659,9 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
s32 err = 0; s32 err = 0;
wdev = kzalloc(sizeof(*wdev), GFP_KERNEL); wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
if (!wdev) { if (!wdev)
WL_ERR("Could not allocate wireless device\n");
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
wdev->wiphy = wdev->wiphy =
wiphy_new(&wl_cfg80211_ops, wiphy_new(&wl_cfg80211_ops,
sizeof(struct brcmf_cfg80211_priv) + sizeof_iface); sizeof(struct brcmf_cfg80211_priv) + sizeof_iface);
...@@ -3124,51 +3122,33 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv) ...@@ -3124,51 +3122,33 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv) static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
{ {
cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL); cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
if (!cfg_priv->scan_results) { if (!cfg_priv->scan_results)
WL_ERR("Scan results alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL); cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL);
if (!cfg_priv->conf) { if (!cfg_priv->conf)
WL_ERR("wl_conf alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL); cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL);
if (!cfg_priv->profile) { if (!cfg_priv->profile)
WL_ERR("wl_profile alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
if (!cfg_priv->bss_info) { if (!cfg_priv->bss_info)
WL_ERR("Bss information alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int), cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int),
GFP_KERNEL); GFP_KERNEL);
if (!cfg_priv->scan_req_int) { if (!cfg_priv->scan_req_int)
WL_ERR("Scan req alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL); cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
if (!cfg_priv->ioctl_buf) { if (!cfg_priv->ioctl_buf)
WL_ERR("Ioctl buf alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
if (!cfg_priv->extra_buf) { if (!cfg_priv->extra_buf)
WL_ERR("Extra buf alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL); cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL);
if (!cfg_priv->iscan) { if (!cfg_priv->iscan)
WL_ERR("Iscan buf alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL); cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL);
if (!cfg_priv->pmk_list) { if (!cfg_priv->pmk_list)
WL_ERR("pmk list alloc failed\n");
goto init_priv_mem_out; goto init_priv_mem_out;
}
return 0; return 0;
...@@ -3210,10 +3190,8 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event, ...@@ -3210,10 +3190,8 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
s32 err = 0; s32 err = 0;
e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL); e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL);
if (!e) { if (!e)
WL_ERR("event alloc failed\n");
return -ENOMEM; return -ENOMEM;
}
e->etype = event; e->etype = event;
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg)); memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
...@@ -3333,10 +3311,8 @@ struct brcmf_cfg80211_dev *brcmf_cfg80211_attach(struct net_device *ndev, ...@@ -3333,10 +3311,8 @@ struct brcmf_cfg80211_dev *brcmf_cfg80211_attach(struct net_device *ndev,
return NULL; return NULL;
} }
cfg_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL); cfg_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL);
if (!cfg_dev) { if (!cfg_dev)
WL_ERR("wl_cfg80211_dev is invalid\n");
return NULL; return NULL;
}
wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface), busdev); wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface), busdev);
if (IS_ERR(wdev)) { if (IS_ERR(wdev)) {
......
...@@ -227,11 +227,9 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc) ...@@ -227,11 +227,9 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc)
int i; int i;
ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC); ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC);
if (!ampdu) { if (!ampdu)
wiphy_err(wlc->wiphy, "wl%d: brcms_c_ampdu_attach: out of mem"
"\n", wlc->pub->unit);
return NULL; return NULL;
}
ampdu->wlc = wlc; ampdu->wlc = wlc;
for (i = 0; i < AMPDU_MAX_SCB_TID; i++) for (i = 0; i < AMPDU_MAX_SCB_TID; i++)
......
...@@ -110,11 +110,8 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc) ...@@ -110,11 +110,8 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc)
struct antsel_info *asi; struct antsel_info *asi;
asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC); asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
if (!asi) { if (!asi)
wiphy_err(wlc->wiphy, "wl%d: brcms_c_antsel_attach: out of "
"mem\n", wlc->pub->unit);
return NULL; return NULL;
}
asi->wlc = wlc; asi->wlc = wlc;
asi->pub = wlc->pub; asi->pub = wlc->pub;
......
...@@ -1090,11 +1090,8 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc) ...@@ -1090,11 +1090,8 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
wlc_cm = kzalloc(sizeof(struct brcms_cm_info), GFP_ATOMIC); wlc_cm = kzalloc(sizeof(struct brcms_cm_info), GFP_ATOMIC);
if (wlc_cm == NULL) { if (wlc_cm == NULL)
wiphy_err(wlc->wiphy, "wl%d: %s: out of memory", pub->unit,
__func__);
return NULL; return NULL;
}
wlc_cm->pub = pub; wlc_cm->pub = pub;
wlc_cm->wlc = wlc; wlc_cm->wlc = wlc;
wlc->cmi = wlc_cm; wlc->cmi = wlc_cm;
......
...@@ -559,12 +559,8 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih, ...@@ -559,12 +559,8 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
/* allocate private info structure */ /* allocate private info structure */
di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC); di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC);
if (di == NULL) { if (di == NULL)
#ifdef BCMDBG
printk(KERN_ERR "dma_attach: out of memory\n");
#endif
return NULL; return NULL;
}
di->msg_level = msg_level ? msg_level : &dma_msg_level; di->msg_level = msg_level ? msg_level : &dma_msg_level;
...@@ -651,23 +647,17 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih, ...@@ -651,23 +647,17 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
if (ntxd) { if (ntxd) {
size = ntxd * sizeof(void *); size = ntxd * sizeof(void *);
di->txp = kzalloc(size, GFP_ATOMIC); di->txp = kzalloc(size, GFP_ATOMIC);
if (di->txp == NULL) { if (di->txp == NULL)
DMA_ERROR(("%s: dma_attach: out of tx memory\n",
di->name));
goto fail; goto fail;
} }
}
/* allocate rx packet pointer vector */ /* allocate rx packet pointer vector */
if (nrxd) { if (nrxd) {
size = nrxd * sizeof(void *); size = nrxd * sizeof(void *);
di->rxp = kzalloc(size, GFP_ATOMIC); di->rxp = kzalloc(size, GFP_ATOMIC);
if (di->rxp == NULL) { if (di->rxp == NULL)
DMA_ERROR(("%s: dma_attach: out of rx memory\n",
di->name));
goto fail; goto fail;
} }
}
/* /*
* allocate transmit descriptor ring, only need ntxd descriptors * allocate transmit descriptor ring, only need ntxd descriptors
......
...@@ -1541,11 +1541,8 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl, ...@@ -1541,11 +1541,8 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
struct brcms_timer *t; struct brcms_timer *t;
t = kzalloc(sizeof(struct brcms_timer), GFP_ATOMIC); t = kzalloc(sizeof(struct brcms_timer), GFP_ATOMIC);
if (!t) { if (!t)
wiphy_err(wl->wiphy, "wl%d: brcms_init_timer: out of memory\n",
wl->pub->unit);
return NULL; return NULL;
}
init_timer(&t->timer); init_timer(&t->timer);
t->timer.data = (unsigned long) t; t->timer.data = (unsigned long) t;
...@@ -1659,11 +1656,9 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx) ...@@ -1659,11 +1656,9 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
pdata = wl->fw.fw_bin[i]->data + pdata = wl->fw.fw_bin[i]->data +
le32_to_cpu(hdr->offset); le32_to_cpu(hdr->offset);
*pbuf = kmalloc(len, GFP_ATOMIC); *pbuf = kmalloc(len, GFP_ATOMIC);
if (*pbuf == NULL) { if (*pbuf == NULL)
wiphy_err(wl->wiphy, "fail to alloc %d"
" bytes\n", len);
goto fail; goto fail;
}
memcpy(*pbuf, pdata, len); memcpy(*pbuf, pdata, len);
return 0; return 0;
} }
......
...@@ -245,9 +245,8 @@ struct pcicore_info *pcicore_init(struct si_pub *sih, struct pci_dev *pdev, ...@@ -245,9 +245,8 @@ struct pcicore_info *pcicore_init(struct si_pub *sih, struct pci_dev *pdev,
/* alloc struct pcicore_info */ /* alloc struct pcicore_info */
pi = kzalloc(sizeof(struct pcicore_info), GFP_ATOMIC); pi = kzalloc(sizeof(struct pcicore_info), GFP_ATOMIC);
if (pi == NULL) { if (pi == NULL)
return NULL; return NULL;
}
pi->sih = sih; pi->sih = sih;
pi->dev = pdev; pi->dev = pdev;
......
...@@ -41,12 +41,9 @@ struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw, ...@@ -41,12 +41,9 @@ struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
struct phy_shim_info *physhim = NULL; struct phy_shim_info *physhim = NULL;
physhim = kzalloc(sizeof(struct phy_shim_info), GFP_ATOMIC); physhim = kzalloc(sizeof(struct phy_shim_info), GFP_ATOMIC);
if (!physhim) { if (!physhim)
wiphy_err(wlc_hw->wlc->wiphy,
"wl%d: wlc_phy_shim_attach: out of mem\n",
wlc_hw->unit);
return NULL; return NULL;
}
physhim->wlc_hw = wlc_hw; physhim->wlc_hw = wlc_hw;
physhim->wlc = wlc; physhim->wlc = wlc;
physhim->wl = wl; physhim->wl = wl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment