drivers/net: Remove unnecessary k.alloc/v.alloc OOM messages
alloc failures use dump_stack so emitting an additional out-of-memory message is an unnecessary duplication. Remove the allocation failure messages. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5f3d9cb296
commit
e404decb0f
@ -180,11 +180,9 @@ static int tlb_initialize(struct bonding *bond)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
new_hashtbl = kzalloc(size, GFP_KERNEL);
|
new_hashtbl = kzalloc(size, GFP_KERNEL);
|
||||||
if (!new_hashtbl) {
|
if (!new_hashtbl)
|
||||||
pr_err("%s: Error: Failed to allocate TLB hash table\n",
|
|
||||||
bond->dev->name);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
_lock_tx_hashtbl_bh(bond);
|
_lock_tx_hashtbl_bh(bond);
|
||||||
|
|
||||||
bond_info->tx_hashtbl = new_hashtbl;
|
bond_info->tx_hashtbl = new_hashtbl;
|
||||||
@ -784,11 +782,9 @@ static int rlb_initialize(struct bonding *bond)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
new_hashtbl = kmalloc(size, GFP_KERNEL);
|
new_hashtbl = kmalloc(size, GFP_KERNEL);
|
||||||
if (!new_hashtbl) {
|
if (!new_hashtbl)
|
||||||
pr_err("%s: Error: Failed to allocate RLB hash table\n",
|
|
||||||
bond->dev->name);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
_lock_rx_hashtbl_bh(bond);
|
_lock_rx_hashtbl_bh(bond);
|
||||||
|
|
||||||
bond_info->rx_hashtbl = new_hashtbl;
|
bond_info->rx_hashtbl = new_hashtbl;
|
||||||
|
@ -639,10 +639,8 @@ static int __init slcan_init(void)
|
|||||||
printk(KERN_INFO "slcan: %d dynamic interface channels.\n", maxdev);
|
printk(KERN_INFO "slcan: %d dynamic interface channels.\n", maxdev);
|
||||||
|
|
||||||
slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
|
slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
|
||||||
if (!slcan_devs) {
|
if (!slcan_devs)
|
||||||
printk(KERN_ERR "slcan: can't allocate slcan device array!\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill in our line protocol discipline, and register it */
|
/* Fill in our line protocol discipline, and register it */
|
||||||
status = tty_register_ldisc(N_SLCAN, &slc_ldisc);
|
status = tty_register_ldisc(N_SLCAN, &slc_ldisc);
|
||||||
|
@ -621,10 +621,8 @@ static void *ni65_alloc_mem(struct net_device *dev,char *what,int size,int type)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ret = ptr = kmalloc(T_BUF_SIZE,GFP_KERNEL | GFP_DMA);
|
ret = ptr = kmalloc(T_BUF_SIZE,GFP_KERNEL | GFP_DMA);
|
||||||
if(!ret) {
|
if(!ret)
|
||||||
printk(KERN_WARNING "%s: unable to allocate %s memory.\n",dev->name,what);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if( (u32) virt_to_phys(ptr+size) > 0x1000000) {
|
if( (u32) virt_to_phys(ptr+size) > 0x1000000) {
|
||||||
printk(KERN_WARNING "%s: unable to allocate %s memory in lower 16MB!\n",dev->name,what);
|
printk(KERN_WARNING "%s: unable to allocate %s memory in lower 16MB!\n",dev->name,what);
|
||||||
|
@ -1660,10 +1660,8 @@ static int __init bmac_init(void)
|
|||||||
{
|
{
|
||||||
if (bmac_emergency_rxbuf == NULL) {
|
if (bmac_emergency_rxbuf == NULL) {
|
||||||
bmac_emergency_rxbuf = kmalloc(RX_BUFLEN, GFP_KERNEL);
|
bmac_emergency_rxbuf = kmalloc(RX_BUFLEN, GFP_KERNEL);
|
||||||
if (bmac_emergency_rxbuf == NULL) {
|
if (bmac_emergency_rxbuf == NULL)
|
||||||
printk(KERN_ERR "BMAC: can't allocate emergency RX buffer\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return macio_register_driver(&bmac_driver);
|
return macio_register_driver(&bmac_driver);
|
||||||
|
@ -136,10 +136,8 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
|
|||||||
*/
|
*/
|
||||||
if (dummy_buf == NULL) {
|
if (dummy_buf == NULL) {
|
||||||
dummy_buf = kmalloc(RX_BUFLEN+2, GFP_KERNEL);
|
dummy_buf = kmalloc(RX_BUFLEN+2, GFP_KERNEL);
|
||||||
if (dummy_buf == NULL) {
|
if (dummy_buf == NULL)
|
||||||
printk(KERN_ERR "MACE: couldn't allocate dummy buffer\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (macio_request_resources(mdev, "mace")) {
|
if (macio_request_resources(mdev, "mace")) {
|
||||||
|
@ -2625,10 +2625,8 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp)
|
|||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
good_mbuf = kmalloc(512 * sizeof(u16), GFP_KERNEL);
|
good_mbuf = kmalloc(512 * sizeof(u16), GFP_KERNEL);
|
||||||
if (good_mbuf == NULL) {
|
if (good_mbuf == NULL)
|
||||||
pr_err("Failed to allocate memory in %s\n", __func__);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
|
REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
|
||||||
BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);
|
BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);
|
||||||
|
@ -10894,10 +10894,8 @@ static inline void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
|
|||||||
do { \
|
do { \
|
||||||
u32 len = be32_to_cpu(fw_hdr->arr.len); \
|
u32 len = be32_to_cpu(fw_hdr->arr.len); \
|
||||||
bp->arr = kmalloc(len, GFP_KERNEL); \
|
bp->arr = kmalloc(len, GFP_KERNEL); \
|
||||||
if (!bp->arr) { \
|
if (!bp->arr) \
|
||||||
pr_err("Failed to allocate %d bytes for "#arr"\n", len); \
|
|
||||||
goto lbl; \
|
goto lbl; \
|
||||||
} \
|
|
||||||
func(bp->firmware->data + be32_to_cpu(fw_hdr->arr.offset), \
|
func(bp->firmware->data + be32_to_cpu(fw_hdr->arr.offset), \
|
||||||
(u8 *)bp->arr, len); \
|
(u8 *)bp->arr, len); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
@ -62,8 +62,6 @@ bnad_debugfs_open_fwtrc(struct inode *inode, struct file *file)
|
|||||||
if (!fw_debug->debug_buffer) {
|
if (!fw_debug->debug_buffer) {
|
||||||
kfree(fw_debug);
|
kfree(fw_debug);
|
||||||
fw_debug = NULL;
|
fw_debug = NULL;
|
||||||
pr_warn("bna %s: Failed to allocate fwtrc buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,8 +103,6 @@ bnad_debugfs_open_fwsave(struct inode *inode, struct file *file)
|
|||||||
if (!fw_debug->debug_buffer) {
|
if (!fw_debug->debug_buffer) {
|
||||||
kfree(fw_debug);
|
kfree(fw_debug);
|
||||||
fw_debug = NULL;
|
fw_debug = NULL;
|
||||||
pr_warn("bna %s: Failed to allocate fwsave buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,8 +204,6 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file)
|
|||||||
if (!drv_info->debug_buffer) {
|
if (!drv_info->debug_buffer) {
|
||||||
kfree(drv_info);
|
kfree(drv_info);
|
||||||
drv_info = NULL;
|
drv_info = NULL;
|
||||||
pr_warn("bna %s: Failed to allocate drv info buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,11 +342,8 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
|
|||||||
|
|
||||||
/* Allocate memory to store the user space buf */
|
/* Allocate memory to store the user space buf */
|
||||||
kern_buf = kzalloc(nbytes, GFP_KERNEL);
|
kern_buf = kzalloc(nbytes, GFP_KERNEL);
|
||||||
if (!kern_buf) {
|
if (!kern_buf)
|
||||||
pr_warn("bna %s: Failed to allocate user buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
if (copy_from_user(kern_buf, (void __user *)buf, nbytes)) {
|
if (copy_from_user(kern_buf, (void __user *)buf, nbytes)) {
|
||||||
kfree(kern_buf);
|
kfree(kern_buf);
|
||||||
@ -373,11 +364,8 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
|
|||||||
bnad->reglen = 0;
|
bnad->reglen = 0;
|
||||||
|
|
||||||
bnad->regdata = kzalloc(len << 2, GFP_KERNEL);
|
bnad->regdata = kzalloc(len << 2, GFP_KERNEL);
|
||||||
if (!bnad->regdata) {
|
if (!bnad->regdata)
|
||||||
pr_warn("bna %s: Failed to allocate regrd buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
bnad->reglen = len << 2;
|
bnad->reglen = len << 2;
|
||||||
rb = bfa_ioc_bar0(ioc);
|
rb = bfa_ioc_bar0(ioc);
|
||||||
@ -421,11 +409,8 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,
|
|||||||
|
|
||||||
/* Allocate memory to store the user space buf */
|
/* Allocate memory to store the user space buf */
|
||||||
kern_buf = kzalloc(nbytes, GFP_KERNEL);
|
kern_buf = kzalloc(nbytes, GFP_KERNEL);
|
||||||
if (!kern_buf) {
|
if (!kern_buf)
|
||||||
pr_warn("bna %s: Failed to allocate user buffer\n",
|
|
||||||
pci_name(bnad->pcidev));
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
if (copy_from_user(kern_buf, (void __user *)buf, nbytes)) {
|
if (copy_from_user(kern_buf, (void __user *)buf, nbytes)) {
|
||||||
kfree(kern_buf);
|
kfree(kern_buf);
|
||||||
|
@ -2388,7 +2388,6 @@ static int __devinit enic_probe(struct pci_dev *pdev,
|
|||||||
/* Allocate structure for port profiles */
|
/* Allocate structure for port profiles */
|
||||||
enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL);
|
enic->pp = kcalloc(num_pps, sizeof(*enic->pp), GFP_KERNEL);
|
||||||
if (!enic->pp) {
|
if (!enic->pp) {
|
||||||
pr_err("port profile alloc failed, aborting\n");
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_out_disable_sriov_pp;
|
goto err_out_disable_sriov_pp;
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,8 @@ static int vnic_rq_alloc_bufs(struct vnic_rq *rq)
|
|||||||
|
|
||||||
for (i = 0; i < blks; i++) {
|
for (i = 0; i < blks; i++) {
|
||||||
rq->bufs[i] = kzalloc(VNIC_RQ_BUF_BLK_SZ(count), GFP_ATOMIC);
|
rq->bufs[i] = kzalloc(VNIC_RQ_BUF_BLK_SZ(count), GFP_ATOMIC);
|
||||||
if (!rq->bufs[i]) {
|
if (!rq->bufs[i])
|
||||||
pr_err("Failed to alloc rq_bufs\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < blks; i++) {
|
for (i = 0; i < blks; i++) {
|
||||||
|
@ -38,10 +38,8 @@ static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
|
|||||||
|
|
||||||
for (i = 0; i < blks; i++) {
|
for (i = 0; i < blks; i++) {
|
||||||
wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ(count), GFP_ATOMIC);
|
wq->bufs[i] = kzalloc(VNIC_WQ_BUF_BLK_SZ(count), GFP_ATOMIC);
|
||||||
if (!wq->bufs[i]) {
|
if (!wq->bufs[i])
|
||||||
pr_err("Failed to alloc wq_bufs\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < blks; i++) {
|
for (i = 0; i < blks; i++) {
|
||||||
|
@ -454,8 +454,6 @@ init_rx_bufs(struct net_device *dev, int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rfd->rbd = rbd;
|
rfd->rbd = rbd;
|
||||||
} else {
|
|
||||||
printk("Could not kmalloc rbd\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lp->rbd_tail->next = rfd->rbd;
|
lp->rbd_tail->next = rfd->rbd;
|
||||||
|
@ -237,11 +237,8 @@ static int __devinit rgmii_probe(struct platform_device *ofdev)
|
|||||||
|
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
dev = kzalloc(sizeof(struct rgmii_instance), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct rgmii_instance), GFP_KERNEL);
|
||||||
if (dev == NULL) {
|
if (dev == NULL)
|
||||||
printk(KERN_ERR "%s: could not allocate RGMII device!\n",
|
|
||||||
np->full_name);
|
|
||||||
goto err_gone;
|
goto err_gone;
|
||||||
}
|
|
||||||
|
|
||||||
mutex_init(&dev->lock);
|
mutex_init(&dev->lock);
|
||||||
dev->ofdev = ofdev;
|
dev->ofdev = ofdev;
|
||||||
|
@ -96,11 +96,8 @@ static int __devinit tah_probe(struct platform_device *ofdev)
|
|||||||
|
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
dev = kzalloc(sizeof(struct tah_instance), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct tah_instance), GFP_KERNEL);
|
||||||
if (dev == NULL) {
|
if (dev == NULL)
|
||||||
printk(KERN_ERR "%s: could not allocate TAH device!\n",
|
|
||||||
np->full_name);
|
|
||||||
goto err_gone;
|
goto err_gone;
|
||||||
}
|
|
||||||
|
|
||||||
mutex_init(&dev->lock);
|
mutex_init(&dev->lock);
|
||||||
dev->ofdev = ofdev;
|
dev->ofdev = ofdev;
|
||||||
|
@ -240,11 +240,8 @@ static int __devinit zmii_probe(struct platform_device *ofdev)
|
|||||||
|
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
dev = kzalloc(sizeof(struct zmii_instance), GFP_KERNEL);
|
dev = kzalloc(sizeof(struct zmii_instance), GFP_KERNEL);
|
||||||
if (dev == NULL) {
|
if (dev == NULL)
|
||||||
printk(KERN_ERR "%s: could not allocate ZMII device!\n",
|
|
||||||
np->full_name);
|
|
||||||
goto err_gone;
|
goto err_gone;
|
||||||
}
|
|
||||||
|
|
||||||
mutex_init(&dev->lock);
|
mutex_init(&dev->lock);
|
||||||
dev->ofdev = ofdev;
|
dev->ofdev = ofdev;
|
||||||
|
@ -730,10 +730,8 @@ static void e1000_dump_eeprom(struct e1000_adapter *adapter)
|
|||||||
eeprom.offset = 0;
|
eeprom.offset = 0;
|
||||||
|
|
||||||
data = kmalloc(eeprom.len, GFP_KERNEL);
|
data = kmalloc(eeprom.len, GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data)
|
||||||
pr_err("Unable to allocate memory to dump EEPROM data\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
ops->get_eeprom(netdev, &eeprom, data);
|
ops->get_eeprom(netdev, &eeprom, data);
|
||||||
|
|
||||||
|
@ -1136,10 +1136,8 @@ ixgb_set_multi(struct net_device *netdev)
|
|||||||
u8 *mta = kmalloc(IXGB_MAX_NUM_MULTICAST_ADDRESSES *
|
u8 *mta = kmalloc(IXGB_MAX_NUM_MULTICAST_ADDRESSES *
|
||||||
ETH_ALEN, GFP_ATOMIC);
|
ETH_ALEN, GFP_ATOMIC);
|
||||||
u8 *addr;
|
u8 *addr;
|
||||||
if (!mta) {
|
if (!mta)
|
||||||
pr_err("allocation of multicast memory failed\n");
|
|
||||||
goto alloc_failed;
|
goto alloc_failed;
|
||||||
}
|
|
||||||
|
|
||||||
IXGB_WRITE_REG(hw, RCTL, rctl);
|
IXGB_WRITE_REG(hw, RCTL, rctl);
|
||||||
|
|
||||||
|
@ -2517,12 +2517,8 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_adapter *adapter,
|
|||||||
|
|
||||||
size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
|
size = sizeof(struct ixgbevf_rx_buffer) * rx_ring->count;
|
||||||
rx_ring->rx_buffer_info = vzalloc(size);
|
rx_ring->rx_buffer_info = vzalloc(size);
|
||||||
if (!rx_ring->rx_buffer_info) {
|
if (!rx_ring->rx_buffer_info)
|
||||||
hw_dbg(&adapter->hw,
|
|
||||||
"Unable to vmalloc buffer memory for "
|
|
||||||
"the receive descriptor ring\n");
|
|
||||||
goto alloc_failed;
|
goto alloc_failed;
|
||||||
}
|
|
||||||
|
|
||||||
/* Round up to nearest 4K */
|
/* Round up to nearest 4K */
|
||||||
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
|
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
|
||||||
|
@ -1150,7 +1150,6 @@ static int korina_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
lp->td_ring = kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
|
lp->td_ring = kmalloc(TD_RING_SIZE + RD_RING_SIZE, GFP_KERNEL);
|
||||||
if (!lp->td_ring) {
|
if (!lp->td_ring) {
|
||||||
printk(KERN_ERR DRV_NAME ": cannot allocate descriptors\n");
|
|
||||||
rc = -ENXIO;
|
rc = -ENXIO;
|
||||||
goto probe_err_td_ring;
|
goto probe_err_td_ring;
|
||||||
}
|
}
|
||||||
|
@ -1017,10 +1017,9 @@ static int rxq_init(struct net_device *dev)
|
|||||||
/* Allocate RX skb rings */
|
/* Allocate RX skb rings */
|
||||||
pep->rx_skb = kmalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size,
|
pep->rx_skb = kmalloc(sizeof(*pep->rx_skb) * pep->rx_ring_size,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!pep->rx_skb) {
|
if (!pep->rx_skb)
|
||||||
printk(KERN_ERR "%s: Cannot alloc RX skb ring\n", dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
/* Allocate RX ring */
|
/* Allocate RX ring */
|
||||||
pep->rx_desc_count = 0;
|
pep->rx_desc_count = 0;
|
||||||
size = pep->rx_ring_size * sizeof(struct rx_desc);
|
size = pep->rx_ring_size * sizeof(struct rx_desc);
|
||||||
@ -1081,10 +1080,9 @@ static int txq_init(struct net_device *dev)
|
|||||||
|
|
||||||
pep->tx_skb = kmalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size,
|
pep->tx_skb = kmalloc(sizeof(*pep->tx_skb) * pep->tx_ring_size,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!pep->tx_skb) {
|
if (!pep->tx_skb)
|
||||||
printk(KERN_ERR "%s: Cannot alloc TX skb ring\n", dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
/* Allocate TX ring */
|
/* Allocate TX ring */
|
||||||
pep->tx_desc_count = 0;
|
pep->tx_desc_count = 0;
|
||||||
size = pep->tx_ring_size * sizeof(struct tx_desc);
|
size = pep->tx_ring_size * sizeof(struct tx_desc);
|
||||||
|
@ -281,10 +281,9 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
|
|||||||
tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS *
|
tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS *
|
||||||
sizeof(struct skb_frag_struct));
|
sizeof(struct skb_frag_struct));
|
||||||
ring->rx_info = vmalloc(tmp);
|
ring->rx_info = vmalloc(tmp);
|
||||||
if (!ring->rx_info) {
|
if (!ring->rx_info)
|
||||||
en_err(priv, "Failed allocating rx_info ring\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
en_dbg(DRV, priv, "Allocated rx_info ring at addr:%p size:%d\n",
|
en_dbg(DRV, priv, "Allocated rx_info ring at addr:%p size:%d\n",
|
||||||
ring->rx_info, tmp);
|
ring->rx_info, tmp);
|
||||||
|
|
||||||
|
@ -71,16 +71,14 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
|
|||||||
|
|
||||||
tmp = size * sizeof(struct mlx4_en_tx_info);
|
tmp = size * sizeof(struct mlx4_en_tx_info);
|
||||||
ring->tx_info = vmalloc(tmp);
|
ring->tx_info = vmalloc(tmp);
|
||||||
if (!ring->tx_info) {
|
if (!ring->tx_info)
|
||||||
en_err(priv, "Failed allocating tx_info ring\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
en_dbg(DRV, priv, "Allocated tx_info ring at addr:%p size:%d\n",
|
en_dbg(DRV, priv, "Allocated tx_info ring at addr:%p size:%d\n",
|
||||||
ring->tx_info, tmp);
|
ring->tx_info, tmp);
|
||||||
|
|
||||||
ring->bounce_buf = kmalloc(MAX_DESC_SIZE, GFP_KERNEL);
|
ring->bounce_buf = kmalloc(MAX_DESC_SIZE, GFP_KERNEL);
|
||||||
if (!ring->bounce_buf) {
|
if (!ring->bounce_buf) {
|
||||||
en_err(priv, "Failed allocating bounce buffer\n");
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_tx;
|
goto err_tx;
|
||||||
}
|
}
|
||||||
|
@ -1501,10 +1501,8 @@ static int ks_hw_init(struct ks_net *ks)
|
|||||||
ks->mcast_lst_size = 0;
|
ks->mcast_lst_size = 0;
|
||||||
|
|
||||||
ks->frame_head_info = kmalloc(MHEADER_SIZE, GFP_KERNEL);
|
ks->frame_head_info = kmalloc(MHEADER_SIZE, GFP_KERNEL);
|
||||||
if (!ks->frame_head_info) {
|
if (!ks->frame_head_info)
|
||||||
pr_err("Error: Fail to allocate frame memory\n");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
ks_set_mac(ks, KS_DEFAULT_MAC_ADDRESS);
|
ks_set_mac(ks, KS_DEFAULT_MAC_ADDRESS);
|
||||||
return true;
|
return true;
|
||||||
|
@ -1587,10 +1587,8 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
|
|||||||
|
|
||||||
size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count;
|
size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count;
|
||||||
tx_ring->buffer_info = vzalloc(size);
|
tx_ring->buffer_info = vzalloc(size);
|
||||||
if (!tx_ring->buffer_info) {
|
if (!tx_ring->buffer_info)
|
||||||
pr_err("Unable to allocate memory for the buffer information\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc);
|
tx_ring->size = tx_ring->count * (int)sizeof(struct pch_gbe_tx_desc);
|
||||||
|
|
||||||
@ -1636,10 +1634,9 @@ int pch_gbe_setup_rx_resources(struct pch_gbe_adapter *adapter,
|
|||||||
|
|
||||||
size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count;
|
size = (int)sizeof(struct pch_gbe_buffer) * rx_ring->count;
|
||||||
rx_ring->buffer_info = vzalloc(size);
|
rx_ring->buffer_info = vzalloc(size);
|
||||||
if (!rx_ring->buffer_info) {
|
if (!rx_ring->buffer_info)
|
||||||
pr_err("Unable to allocate memory for the receive descriptor ring\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
|
rx_ring->size = rx_ring->count * (int)sizeof(struct pch_gbe_rx_desc);
|
||||||
rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
|
rx_ring->desc = dma_alloc_coherent(&pdev->dev, rx_ring->size,
|
||||||
&rx_ring->dma, GFP_KERNEL);
|
&rx_ring->dma, GFP_KERNEL);
|
||||||
|
@ -280,13 +280,10 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)
|
|||||||
|
|
||||||
}
|
}
|
||||||
rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
|
rds_ring->rx_buf_arr = vzalloc(RCV_BUFF_RINGSIZE(rds_ring));
|
||||||
if (rds_ring->rx_buf_arr == NULL) {
|
if (rds_ring->rx_buf_arr == NULL)
|
||||||
printk(KERN_ERR "%s: Failed to allocate "
|
|
||||||
"rx buffer ring %d\n",
|
|
||||||
netdev->name, ring);
|
|
||||||
/* free whatever was already allocated */
|
/* free whatever was already allocated */
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
|
||||||
INIT_LIST_HEAD(&rds_ring->free_list);
|
INIT_LIST_HEAD(&rds_ring->free_list);
|
||||||
/*
|
/*
|
||||||
* Now go through all of them, set reference handles
|
* Now go through all of them, set reference handles
|
||||||
@ -480,11 +477,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
buf = kcalloc(n, sizeof(struct crb_addr_pair), GFP_KERNEL);
|
buf = kcalloc(n, sizeof(struct crb_addr_pair), GFP_KERNEL);
|
||||||
if (buf == NULL) {
|
if (buf == NULL)
|
||||||
printk("%s: netxen_pinit_from_rom: Unable to calloc memory.\n",
|
|
||||||
netxen_nic_driver_name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 ||
|
if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 ||
|
||||||
|
@ -1824,10 +1824,8 @@ void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id)
|
|||||||
pr_err("%s: Enter\n", __func__);
|
pr_err("%s: Enter\n", __func__);
|
||||||
|
|
||||||
ptr = kmalloc(size, GFP_ATOMIC);
|
ptr = kmalloc(size, GFP_ATOMIC);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL)
|
||||||
pr_err("%s: Couldn't allocate a buffer\n", __func__);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (ql_write_cfg(qdev, ptr, size, bit, q_id)) {
|
if (ql_write_cfg(qdev, ptr, size, bit, q_id)) {
|
||||||
pr_err("%s: Failed to upload control block!\n", __func__);
|
pr_err("%s: Failed to upload control block!\n", __func__);
|
||||||
|
@ -619,7 +619,6 @@ static int __devinit sis900_mii_probe(struct net_device * net_dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) {
|
if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) {
|
||||||
printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n");
|
|
||||||
mii_phy = sis_priv->first_mii;
|
mii_phy = sis_priv->first_mii;
|
||||||
while (mii_phy) {
|
while (mii_phy) {
|
||||||
struct mii_phy *phy;
|
struct mii_phy *phy;
|
||||||
|
@ -954,10 +954,9 @@ static int stmmac_open(struct net_device *dev)
|
|||||||
|
|
||||||
#ifdef CONFIG_STMMAC_TIMER
|
#ifdef CONFIG_STMMAC_TIMER
|
||||||
priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL);
|
priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL);
|
||||||
if (unlikely(priv->tm == NULL)) {
|
if (unlikely(priv->tm == NULL))
|
||||||
pr_err("%s: ERROR: timer memory alloc failed\n", __func__);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
priv->tm->freq = tmrate;
|
priv->tm->freq = tmrate;
|
||||||
|
|
||||||
/* Test if the external timer can be actually used.
|
/* Test if the external timer can be actually used.
|
||||||
|
@ -835,7 +835,6 @@ static int cas_saturn_firmware_init(struct cas *cp)
|
|||||||
cp->fw_data = vmalloc(cp->fw_size);
|
cp->fw_data = vmalloc(cp->fw_size);
|
||||||
if (!cp->fw_data) {
|
if (!cp->fw_data) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
pr_err("\"%s\" Failed %d\n", fw_name, err);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
memcpy(cp->fw_data, &fw->data[2], cp->fw_size);
|
memcpy(cp->fw_data, &fw->data[2], cp->fw_size);
|
||||||
|
@ -949,10 +949,9 @@ static int __devinit vnet_port_alloc_tx_bufs(struct vnet_port *port)
|
|||||||
int map_len = (ETH_FRAME_LEN + 7) & ~7;
|
int map_len = (ETH_FRAME_LEN + 7) & ~7;
|
||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
if (!buf) {
|
if (!buf)
|
||||||
pr_err("TX buffer allocation failure\n");
|
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
if ((unsigned long)buf & (8UL - 1)) {
|
if ((unsigned long)buf & (8UL - 1)) {
|
||||||
pr_err("TX buffer misaligned\n");
|
pr_err("TX buffer misaligned\n");
|
||||||
@ -1165,10 +1164,8 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev,
|
|||||||
|
|
||||||
port = kzalloc(sizeof(*port), GFP_KERNEL);
|
port = kzalloc(sizeof(*port), GFP_KERNEL);
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
if (!port) {
|
if (!port)
|
||||||
pr_err("Cannot allocate vnet_port\n");
|
|
||||||
goto err_out_put_mdesc;
|
goto err_out_put_mdesc;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < ETH_ALEN; i++)
|
for (i = 0; i < ETH_ALEN; i++)
|
||||||
port->raddr[i] = (*rmac >> (5 - i) * 8) & 0xff;
|
port->raddr[i] = (*rmac >> (5 - i) * 8) & 0xff;
|
||||||
|
@ -1621,10 +1621,9 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
|
|||||||
kfree(target->hwinfo);
|
kfree(target->hwinfo);
|
||||||
target->hwinfo = kzalloc(be16_to_cpu(scan_info->size),
|
target->hwinfo = kzalloc(be16_to_cpu(scan_info->size),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!target->hwinfo) {
|
if (!target->hwinfo)
|
||||||
pr_info("%s: kzalloc failed\n", __func__);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
/* copy hw scan info */
|
/* copy hw scan info */
|
||||||
memcpy(target->hwinfo, scan_info, scan_info->size);
|
memcpy(target->hwinfo, scan_info, scan_info->size);
|
||||||
target->essid_len = strnlen(scan_info->essid,
|
target->essid_len = strnlen(scan_info->essid,
|
||||||
|
@ -403,7 +403,6 @@ static unsigned char *add_mcs(unsigned char *bits, int bitrate,
|
|||||||
|
|
||||||
/* Allocate a new mcs */
|
/* Allocate a new mcs */
|
||||||
if ((p = kmalloc(sizeof(struct yam_mcs), GFP_KERNEL)) == NULL) {
|
if ((p = kmalloc(sizeof(struct yam_mcs), GFP_KERNEL)) == NULL) {
|
||||||
printk(KERN_WARNING "YAM: no memory to allocate mcs\n");
|
|
||||||
release_firmware(fw);
|
release_firmware(fw);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1600,12 +1600,8 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
||||||
if (!image){
|
if (!image)
|
||||||
printk(KERN_ERR "%s: Unable to allocate memory "
|
|
||||||
"for EEPROM image\n", dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (rrpriv->fw_running){
|
if (rrpriv->fw_running){
|
||||||
printk("%s: Firmware already running\n", dev->name);
|
printk("%s: Firmware already running\n", dev->name);
|
||||||
@ -1637,8 +1633,6 @@ static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
|
|||||||
image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
image = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
||||||
oldimage = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
oldimage = kmalloc(EEPROM_WORDS * sizeof(u32), GFP_KERNEL);
|
||||||
if (!image || !oldimage) {
|
if (!image || !oldimage) {
|
||||||
printk(KERN_ERR "%s: Unable to allocate memory "
|
|
||||||
"for EEPROM image\n", dev->name);
|
|
||||||
error = -ENOMEM;
|
error = -ENOMEM;
|
||||||
goto wf_out;
|
goto wf_out;
|
||||||
}
|
}
|
||||||
|
@ -1608,7 +1608,6 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
|
|||||||
self->ringbuf = kmalloc(OBOE_RING_LEN << 1, GFP_KERNEL);
|
self->ringbuf = kmalloc(OBOE_RING_LEN << 1, GFP_KERNEL);
|
||||||
if (!self->ringbuf)
|
if (!self->ringbuf)
|
||||||
{
|
{
|
||||||
printk (KERN_ERR DRIVER_NAME ": can't allocate DMA buffers\n");
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto freeregion;
|
goto freeregion;
|
||||||
}
|
}
|
||||||
@ -1647,7 +1646,6 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
|
|||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
printk (KERN_ERR DRIVER_NAME ": can't allocate rx/tx buffers\n");
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto freebufs;
|
goto freebufs;
|
||||||
}
|
}
|
||||||
|
@ -169,10 +169,8 @@ static struct netconsole_target *alloc_param_target(char *target_config)
|
|||||||
* Note that these targets get their config_item fields zeroed-out.
|
* Note that these targets get their config_item fields zeroed-out.
|
||||||
*/
|
*/
|
||||||
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
|
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
|
||||||
if (!nt) {
|
if (!nt)
|
||||||
printk(KERN_ERR "netconsole: failed to allocate memory\n");
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
|
||||||
|
|
||||||
nt->np.name = "netconsole";
|
nt->np.name = "netconsole";
|
||||||
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
|
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
|
||||||
@ -551,10 +549,8 @@ static struct config_item *make_netconsole_target(struct config_group *group,
|
|||||||
* Target is disabled at creation (enabled == 0).
|
* Target is disabled at creation (enabled == 0).
|
||||||
*/
|
*/
|
||||||
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
|
nt = kzalloc(sizeof(*nt), GFP_KERNEL);
|
||||||
if (!nt) {
|
if (!nt)
|
||||||
printk(KERN_ERR "netconsole: failed to allocate memory\n");
|
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
nt->np.name = "netconsole";
|
nt->np.name = "netconsole";
|
||||||
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
|
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
|
||||||
|
@ -670,10 +670,8 @@ static int __init pptp_init_module(void)
|
|||||||
pr_info("PPTP driver version " PPTP_DRIVER_VERSION "\n");
|
pr_info("PPTP driver version " PPTP_DRIVER_VERSION "\n");
|
||||||
|
|
||||||
callid_sock = vzalloc((MAX_CALLID + 1) * sizeof(void *));
|
callid_sock = vzalloc((MAX_CALLID + 1) * sizeof(void *));
|
||||||
if (!callid_sock) {
|
if (!callid_sock)
|
||||||
pr_err("PPTP: cann't allocate memory\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
err = gre_add_protocol(&gre_pptp_protocol, GREPROTO_PPTP);
|
err = gre_add_protocol(&gre_pptp_protocol, GREPROTO_PPTP);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -1296,10 +1296,8 @@ static int __init slip_init(void)
|
|||||||
|
|
||||||
slip_devs = kzalloc(sizeof(struct net_device *)*slip_maxdev,
|
slip_devs = kzalloc(sizeof(struct net_device *)*slip_maxdev,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!slip_devs) {
|
if (!slip_devs)
|
||||||
printk(KERN_ERR "SLIP: Can't allocate slip devices array.\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fill in our line protocol discipline, and register it */
|
/* Fill in our line protocol discipline, and register it */
|
||||||
status = tty_register_ldisc(N_SLIP, &sl_ldisc);
|
status = tty_register_ldisc(N_SLIP, &sl_ldisc);
|
||||||
|
@ -674,15 +674,11 @@ static int xl_open(struct net_device *dev)
|
|||||||
/* These MUST be on 8 byte boundaries */
|
/* These MUST be on 8 byte boundaries */
|
||||||
xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
|
xl_priv->xl_tx_ring = kzalloc((sizeof(struct xl_tx_desc) * XL_TX_RING_SIZE) + 7, GFP_DMA | GFP_KERNEL);
|
||||||
if (xl_priv->xl_tx_ring == NULL) {
|
if (xl_priv->xl_tx_ring == NULL) {
|
||||||
printk(KERN_WARNING "%s: Not enough memory to allocate tx buffers.\n",
|
|
||||||
dev->name);
|
|
||||||
free_irq(dev->irq,dev);
|
free_irq(dev->irq,dev);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
|
xl_priv->xl_rx_ring = kzalloc((sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE) +7, GFP_DMA | GFP_KERNEL);
|
||||||
if (xl_priv->xl_rx_ring == NULL) {
|
if (xl_priv->xl_rx_ring == NULL) {
|
||||||
printk(KERN_WARNING "%s: Not enough memory to allocate rx buffers.\n",
|
|
||||||
dev->name);
|
|
||||||
free_irq(dev->irq,dev);
|
free_irq(dev->irq,dev);
|
||||||
kfree(xl_priv->xl_tx_ring);
|
kfree(xl_priv->xl_tx_ring);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -171,7 +171,6 @@ static int __devinit madgemc_probe(struct device *device)
|
|||||||
|
|
||||||
card = kmalloc(sizeof(struct card_info), GFP_KERNEL);
|
card = kmalloc(sizeof(struct card_info), GFP_KERNEL);
|
||||||
if (card==NULL) {
|
if (card==NULL) {
|
||||||
printk("madgemc: unable to allocate card struct\n");
|
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto getout1;
|
goto getout1;
|
||||||
}
|
}
|
||||||
|
@ -537,11 +537,8 @@ vmxnet3_tq_create(struct vmxnet3_tx_queue *tq,
|
|||||||
|
|
||||||
tq->buf_info = kcalloc(tq->tx_ring.size, sizeof(tq->buf_info[0]),
|
tq->buf_info = kcalloc(tq->tx_ring.size, sizeof(tq->buf_info[0]),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!tq->buf_info) {
|
if (!tq->buf_info)
|
||||||
printk(KERN_ERR "%s: failed to allocate tx bufinfo\n",
|
|
||||||
adapter->netdev->name);
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1519,11 +1516,9 @@ vmxnet3_rq_create(struct vmxnet3_rx_queue *rq, struct vmxnet3_adapter *adapter)
|
|||||||
sz = sizeof(struct vmxnet3_rx_buf_info) * (rq->rx_ring[0].size +
|
sz = sizeof(struct vmxnet3_rx_buf_info) * (rq->rx_ring[0].size +
|
||||||
rq->rx_ring[1].size);
|
rq->rx_ring[1].size);
|
||||||
bi = kzalloc(sz, GFP_KERNEL);
|
bi = kzalloc(sz, GFP_KERNEL);
|
||||||
if (!bi) {
|
if (!bi)
|
||||||
printk(KERN_ERR "%s: failed to allocate rx bufinfo\n",
|
|
||||||
adapter->netdev->name);
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
rq->buf_info[0] = bi;
|
rq->buf_info[0] = bi;
|
||||||
rq->buf_info[1] = bi + rq->rx_ring[0].size;
|
rq->buf_info[1] = bi + rq->rx_ring[0].size;
|
||||||
|
|
||||||
@ -2964,8 +2959,6 @@ vmxnet3_probe_device(struct pci_dev *pdev,
|
|||||||
|
|
||||||
adapter->pm_conf = kmalloc(sizeof(struct Vmxnet3_PMConf), GFP_KERNEL);
|
adapter->pm_conf = kmalloc(sizeof(struct Vmxnet3_PMConf), GFP_KERNEL);
|
||||||
if (adapter->pm_conf == NULL) {
|
if (adapter->pm_conf == NULL) {
|
||||||
printk(KERN_ERR "Failed to allocate memory for %s\n",
|
|
||||||
pci_name(pdev));
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_alloc_pm;
|
goto err_alloc_pm;
|
||||||
}
|
}
|
||||||
@ -2974,8 +2967,6 @@ vmxnet3_probe_device(struct pci_dev *pdev,
|
|||||||
|
|
||||||
adapter->rss_conf = kmalloc(sizeof(struct UPT1_RSSConf), GFP_KERNEL);
|
adapter->rss_conf = kmalloc(sizeof(struct UPT1_RSSConf), GFP_KERNEL);
|
||||||
if (adapter->rss_conf == NULL) {
|
if (adapter->rss_conf == NULL) {
|
||||||
printk(KERN_ERR "Failed to allocate memory for %s\n",
|
|
||||||
pci_name(pdev));
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_alloc_rss;
|
goto err_alloc_rss;
|
||||||
}
|
}
|
||||||
|
@ -325,10 +325,8 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
||||||
if (card == NULL) {
|
if (card == NULL)
|
||||||
pr_err("unable to allocate memory\n");
|
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
}
|
|
||||||
|
|
||||||
card->dev = alloc_hdlcdev(card);
|
card->dev = alloc_hdlcdev(card);
|
||||||
if (!card->dev) {
|
if (!card->dev) {
|
||||||
|
@ -903,10 +903,8 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
|
|||||||
int i, ret = -ENOMEM;
|
int i, ret = -ENOMEM;
|
||||||
|
|
||||||
root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
|
root = kcalloc(dev_per_card, sizeof(*root), GFP_KERNEL);
|
||||||
if (!root) {
|
if (!root)
|
||||||
pr_err("can't allocate data\n");
|
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < dev_per_card; i++) {
|
for (i = 0; i < dev_per_card; i++) {
|
||||||
root[i].dev = alloc_hdlcdev(root + i);
|
root[i].dev = alloc_hdlcdev(root + i);
|
||||||
@ -915,10 +913,8 @@ static int dscc4_found1(struct pci_dev *pdev, void __iomem *ioaddr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
|
ppriv = kzalloc(sizeof(*ppriv), GFP_KERNEL);
|
||||||
if (!ppriv) {
|
if (!ppriv)
|
||||||
pr_err("can't allocate private data\n");
|
|
||||||
goto err_free_dev;
|
goto err_free_dev;
|
||||||
}
|
|
||||||
|
|
||||||
ppriv->root = root;
|
ppriv->root = root;
|
||||||
spin_lock_init(&ppriv->lock);
|
spin_lock_init(&ppriv->lock);
|
||||||
|
@ -497,7 +497,6 @@ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
|
|||||||
|
|
||||||
data = kmalloc(xc.len, GFP_KERNEL);
|
data = kmalloc(xc.len, GFP_KERNEL);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
printk(KERN_WARNING "%s: Failed to allocate memory for copy\n", dev->name);
|
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -358,10 +358,8 @@ static int __init n2_run(unsigned long io, unsigned long irq,
|
|||||||
}
|
}
|
||||||
|
|
||||||
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
||||||
if (card == NULL) {
|
if (card == NULL)
|
||||||
pr_err("unable to allocate memory\n");
|
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
}
|
|
||||||
|
|
||||||
card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
|
card->ports[0].dev = alloc_hdlcdev(&card->ports[0]);
|
||||||
card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
|
card->ports[1].dev = alloc_hdlcdev(&card->ports[1]);
|
||||||
|
@ -320,7 +320,6 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
|
|||||||
|
|
||||||
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
||||||
if (card == NULL) {
|
if (card == NULL) {
|
||||||
pr_err("unable to allocate memory\n");
|
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
@ -299,7 +299,6 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
|
|||||||
|
|
||||||
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
card = kzalloc(sizeof(card_t), GFP_KERNEL);
|
||||||
if (card == NULL) {
|
if (card == NULL) {
|
||||||
pr_err("unable to allocate memory\n");
|
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
@ -604,7 +604,6 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
|
|||||||
alloc_size = sizeof(card_t) + ports * sizeof(port_t);
|
alloc_size = sizeof(card_t) + ports * sizeof(port_t);
|
||||||
card = kzalloc(alloc_size, GFP_KERNEL);
|
card = kzalloc(alloc_size, GFP_KERNEL);
|
||||||
if (card == NULL) {
|
if (card == NULL) {
|
||||||
pr_err("%s: unable to allocate memory\n", pci_name(pdev));
|
|
||||||
pci_release_regions(pdev);
|
pci_release_regions(pdev);
|
||||||
pci_disable_device(pdev);
|
pci_disable_device(pdev);
|
||||||
return -ENOBUFS;
|
return -ENOBUFS;
|
||||||
|
@ -786,10 +786,8 @@ static int __init init_x25_asy(void)
|
|||||||
|
|
||||||
x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *),
|
x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!x25_asy_devs) {
|
if (!x25_asy_devs)
|
||||||
pr_warn("Can't allocate x25_asy_ctrls[] array! Uaargh! (-> No X.25 available)\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
return tty_register_ldisc(N_X25, &x25_ldisc);
|
return tty_register_ldisc(N_X25, &x25_ldisc);
|
||||||
}
|
}
|
||||||
|
@ -431,11 +431,8 @@ struct htc_target *ath9k_htc_hw_alloc(void *hif_handle,
|
|||||||
struct htc_target *target;
|
struct htc_target *target;
|
||||||
|
|
||||||
target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
|
target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
|
||||||
if (!target) {
|
if (!target)
|
||||||
printk(KERN_ERR "Unable to allocate memory for"
|
|
||||||
"target device\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
init_completion(&target->target_wait);
|
init_completion(&target->target_wait);
|
||||||
init_completion(&target->cmd_wait);
|
init_completion(&target->cmd_wait);
|
||||||
|
@ -347,11 +347,9 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
|
|||||||
return -EINTR;
|
return -EINTR;
|
||||||
|
|
||||||
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
||||||
if (entry == NULL) {
|
if (entry == NULL)
|
||||||
printk(KERN_DEBUG "%s: hfa384x_cmd - kmalloc failed\n",
|
|
||||||
dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
atomic_set(&entry->usecnt, 1);
|
atomic_set(&entry->usecnt, 1);
|
||||||
entry->type = CMD_SLEEP;
|
entry->type = CMD_SLEEP;
|
||||||
entry->cmd = cmd;
|
entry->cmd = cmd;
|
||||||
@ -515,11 +513,9 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
|
||||||
if (entry == NULL) {
|
if (entry == NULL)
|
||||||
printk(KERN_DEBUG "%s: hfa384x_cmd_callback - kmalloc "
|
|
||||||
"failed\n", dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
atomic_set(&entry->usecnt, 1);
|
atomic_set(&entry->usecnt, 1);
|
||||||
entry->type = CMD_CALLBACK;
|
entry->type = CMD_CALLBACK;
|
||||||
entry->cmd = cmd;
|
entry->cmd = cmd;
|
||||||
@ -2978,11 +2974,9 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set)
|
|||||||
local = iface->local;
|
local = iface->local;
|
||||||
|
|
||||||
new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC);
|
new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC);
|
||||||
if (new_entry == NULL) {
|
if (new_entry == NULL)
|
||||||
printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n",
|
|
||||||
local->dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
new_entry->aid = aid;
|
new_entry->aid = aid;
|
||||||
new_entry->set = set;
|
new_entry->set = set;
|
||||||
|
|
||||||
|
@ -3464,11 +3464,8 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
|
|||||||
priv->msg_buffers =
|
priv->msg_buffers =
|
||||||
kmalloc(IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
|
kmalloc(IPW_COMMAND_POOL_SIZE * sizeof(struct ipw2100_tx_packet),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!priv->msg_buffers) {
|
if (!priv->msg_buffers)
|
||||||
printk(KERN_ERR DRV_NAME ": %s: PCI alloc failed for msg "
|
|
||||||
"buffers.\n", priv->net_dev->name);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) {
|
for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) {
|
||||||
v = pci_alloc_consistent(priv->pci_dev,
|
v = pci_alloc_consistent(priv->pci_dev,
|
||||||
|
@ -815,10 +815,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
|
|||||||
lbs_deb_enter(LBS_DEB_CS);
|
lbs_deb_enter(LBS_DEB_CS);
|
||||||
|
|
||||||
card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
|
card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
|
||||||
if (!card) {
|
if (!card)
|
||||||
pr_err("error in kzalloc\n");
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
card->p_dev = p_dev;
|
card->p_dev = p_dev;
|
||||||
p_dev->priv = card;
|
p_dev->priv = card;
|
||||||
|
|
||||||
|
@ -261,10 +261,8 @@ static int if_usb_probe(struct usb_interface *intf,
|
|||||||
udev = interface_to_usbdev(intf);
|
udev = interface_to_usbdev(intf);
|
||||||
|
|
||||||
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
|
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
|
||||||
if (!cardp) {
|
if (!cardp)
|
||||||
pr_err("Out of memory allocating private data\n");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
setup_timer(&cardp->fw_timeout, if_usb_fw_timeo, (unsigned long)cardp);
|
setup_timer(&cardp->fw_timeout, if_usb_fw_timeo, (unsigned long)cardp);
|
||||||
init_waitqueue_head(&cardp->fw_wq);
|
init_waitqueue_head(&cardp->fw_wq);
|
||||||
|
@ -153,10 +153,8 @@ static int if_usb_probe(struct usb_interface *intf,
|
|||||||
udev = interface_to_usbdev(intf);
|
udev = interface_to_usbdev(intf);
|
||||||
|
|
||||||
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
|
cardp = kzalloc(sizeof(struct if_usb_card), GFP_KERNEL);
|
||||||
if (!cardp) {
|
if (!cardp)
|
||||||
pr_err("Out of memory allocating private data.\n");
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
|
|
||||||
setup_timer(&cardp->fw_timeout, if_usb_fw_timeo, (unsigned long)cardp);
|
setup_timer(&cardp->fw_timeout, if_usb_fw_timeo, (unsigned long)cardp);
|
||||||
init_waitqueue_head(&cardp->fw_wq);
|
init_waitqueue_head(&cardp->fw_wq);
|
||||||
|
@ -86,10 +86,8 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
|
|||||||
pdev->vendor, pdev->device, pdev->revision);
|
pdev->vendor, pdev->device, pdev->revision);
|
||||||
|
|
||||||
card = kzalloc(sizeof(struct pcie_service_card), GFP_KERNEL);
|
card = kzalloc(sizeof(struct pcie_service_card), GFP_KERNEL);
|
||||||
if (!card) {
|
if (!card)
|
||||||
pr_err("%s: failed to alloc memory\n", __func__);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
card->dev = pdev;
|
card->dev = pdev;
|
||||||
|
|
||||||
|
@ -70,10 +70,8 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
|
|||||||
func->vendor, func->device, func->class, func->num);
|
func->vendor, func->device, func->class, func->num);
|
||||||
|
|
||||||
card = kzalloc(sizeof(struct sdio_mmc_card), GFP_KERNEL);
|
card = kzalloc(sizeof(struct sdio_mmc_card), GFP_KERNEL);
|
||||||
if (!card) {
|
if (!card)
|
||||||
pr_err("%s: failed to alloc memory\n", __func__);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
card->func = func;
|
card->func = func;
|
||||||
|
|
||||||
|
@ -941,11 +941,9 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
|
|||||||
|
|
||||||
/* Add desc and skb to rx queue */
|
/* Add desc and skb to rx queue */
|
||||||
rx_data = kzalloc(sizeof(*rx_data), GFP_ATOMIC);
|
rx_data = kzalloc(sizeof(*rx_data), GFP_ATOMIC);
|
||||||
if (!rx_data) {
|
if (!rx_data)
|
||||||
printk(KERN_WARNING "%s: Can't allocate RX packet\n",
|
|
||||||
dev->name);
|
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
|
||||||
rx_data->desc = desc;
|
rx_data->desc = desc;
|
||||||
rx_data->skb = skb;
|
rx_data->skb = skb;
|
||||||
list_add_tail(&rx_data->list, &priv->rx_list);
|
list_add_tail(&rx_data->list, &priv->rx_list);
|
||||||
|
@ -192,11 +192,9 @@ islpci_mgt_transmit(struct net_device *ndev, int operation, unsigned long oid,
|
|||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
p = buf.mem = kmalloc(frag_len, GFP_KERNEL);
|
p = buf.mem = kmalloc(frag_len, GFP_KERNEL);
|
||||||
if (!buf.mem) {
|
if (!buf.mem)
|
||||||
printk(KERN_DEBUG "%s: cannot allocate mgmt frame\n",
|
|
||||||
ndev->name);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
|
||||||
buf.size = frag_len;
|
buf.size = frag_len;
|
||||||
|
|
||||||
/* create the header directly in the fragment data area */
|
/* create the header directly in the fragment data area */
|
||||||
|
@ -186,11 +186,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
|
|||||||
|
|
||||||
/* for firmware buf */
|
/* for firmware buf */
|
||||||
rtlpriv->rtlhal.pfirmware = vzalloc(sizeof(struct rt_firmware));
|
rtlpriv->rtlhal.pfirmware = vzalloc(sizeof(struct rt_firmware));
|
||||||
if (!rtlpriv->rtlhal.pfirmware) {
|
if (!rtlpriv->rtlhal.pfirmware)
|
||||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
|
||||||
("Can't alloc buffer for fw.\n"));
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n"
|
pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n"
|
||||||
"Loading firmware %s\n", rtlpriv->cfg->fw_name);
|
"Loading firmware %s\n", rtlpriv->cfg->fw_name);
|
||||||
|
@ -1639,10 +1639,8 @@ static int __init netback_init(void)
|
|||||||
|
|
||||||
xen_netbk_group_nr = num_online_cpus();
|
xen_netbk_group_nr = num_online_cpus();
|
||||||
xen_netbk = vzalloc(sizeof(struct xen_netbk) * xen_netbk_group_nr);
|
xen_netbk = vzalloc(sizeof(struct xen_netbk) * xen_netbk_group_nr);
|
||||||
if (!xen_netbk) {
|
if (!xen_netbk)
|
||||||
printk(KERN_ALERT "%s: out of memory\n", __func__);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
for (group = 0; group < xen_netbk_group_nr; group++) {
|
for (group = 0; group < xen_netbk_group_nr; group++) {
|
||||||
struct xen_netbk *netbk = &xen_netbk[group];
|
struct xen_netbk *netbk = &xen_netbk[group];
|
||||||
|
Loading…
Reference in New Issue
Block a user