Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352057
b: refs/heads/master
c: b2adaca
h: refs/heads/master
i:
  352055: 5b36381
v: v3
  • Loading branch information
Joe Perches authored and David S. Miller committed Feb 4, 2013
1 parent 1da9ef4 commit 6842566
Show file tree
Hide file tree
Showing 39 changed files with 98 additions and 198 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 09da6c5f60ad2e2018366e47192a9ddbccfb3ac5
refs/heads/master: b2adaca92c63b9bb8beb021d554f656e387a7648
6 changes: 2 additions & 4 deletions trunk/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,9 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
size = sizeof(struct atl1c_buffer) * (tpd_ring->count * 2 +
rfd_ring->count);
tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL);
if (unlikely(!tpd_ring->buffer_info)) {
dev_err(&pdev->dev, "kzalloc failed, size = %d\n",
size);
if (unlikely(!tpd_ring->buffer_info))
goto err_nomem;
}

for (i = 0; i < AT_MAX_TRANSMIT_QUEUE; i++) {
tpd_ring[i].buffer_info =
(tpd_ring->buffer_info + count);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,6 @@ static int atl1e_setup_ring_resources(struct atl1e_adapter *adapter)
size = sizeof(struct atl1e_tx_buffer) * (tx_ring->count);
tx_ring->tx_buffer = kzalloc(size, GFP_KERNEL);
if (tx_ring->tx_buffer == NULL) {
netdev_err(adapter->netdev, "kzalloc failed, size = D%d\n",
size);
err = -ENOMEM;
goto failed;
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/broadcom/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -1518,10 +1518,8 @@ static void b44_setup_pseudo_magicp(struct b44 *bp)
u8 pwol_mask[B44_PMASK_SIZE];

pwol_pattern = kzalloc(B44_PATTERN_SIZE, GFP_KERNEL);
if (!pwol_pattern) {
pr_err("Memory not available for WOL\n");
if (!pwol_pattern)
return;
}

/* Ipv4 magic packet pattern - pattern 0.*/
memset(pwol_mask, 0, B44_PMASK_SIZE);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/ethernet/broadcom/bcm63xx_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,9 @@ static int bcm_enet_open(struct net_device *dev)
priv->tx_desc_alloc_size = size;
priv->tx_desc_cpu = p;

priv->tx_skb = kzalloc(sizeof(struct sk_buff *) * priv->tx_ring_size,
priv->tx_skb = kcalloc(priv->tx_ring_size, sizeof(struct sk_buff *),
GFP_KERNEL);
if (!priv->tx_skb) {
dev_err(kdev, "cannot allocate rx skb queue\n");
ret = -ENOMEM;
goto out_free_tx_ring;
}
Expand All @@ -900,10 +899,9 @@ static int bcm_enet_open(struct net_device *dev)
spin_lock_init(&priv->tx_lock);

/* init & fill rx ring with skbs */
priv->rx_skb = kzalloc(sizeof(struct sk_buff *) * priv->rx_ring_size,
priv->rx_skb = kcalloc(priv->rx_ring_size, sizeof(struct sk_buff *),
GFP_KERNEL);
if (!priv->rx_skb) {
dev_err(kdev, "cannot allocate rx skb queue\n");
ret = -ENOMEM;
goto out_free_tx_skb;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/net/ethernet/broadcom/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -5425,11 +5425,9 @@ static struct cnic_dev *cnic_alloc_dev(struct net_device *dev,

alloc_size = sizeof(struct cnic_dev) + sizeof(struct cnic_local);

cdev = kzalloc(alloc_size , GFP_KERNEL);
if (cdev == NULL) {
netdev_err(dev, "allocate dev struct failure\n");
cdev = kzalloc(alloc_size, GFP_KERNEL);
if (cdev == NULL)
return NULL;
}

cdev->netdev = dev;
cdev->cnic_priv = (char *)cdev + sizeof(struct cnic_dev);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -5793,10 +5793,8 @@ static void tg3_dump_state(struct tg3 *tp)
u32 *regs;

regs = kzalloc(TG3_REG_BLK_SIZE, GFP_ATOMIC);
if (!regs) {
netdev_err(tp->dev, "Failed allocating register dump buffer\n");
if (!regs)
return;
}

if (tg3_flag(tp, PCI_EXPRESS)) {
/* Read up to but not including private PCI registers */
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/net/ethernet/freescale/gianfar_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,11 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow,
int j = MAX_FILER_IDX, l = 0x0;
int ret = 1;

local_rqfpr = kmalloc(sizeof(unsigned int) * (MAX_FILER_IDX + 1),
GFP_KERNEL);
local_rqfcr = kmalloc(sizeof(unsigned int) * (MAX_FILER_IDX + 1),
GFP_KERNEL);
local_rqfpr = kmalloc_array(MAX_FILER_IDX + 1, sizeof(unsigned int),
GFP_KERNEL);
local_rqfcr = kmalloc_array(MAX_FILER_IDX + 1, sizeof(unsigned int),
GFP_KERNEL);
if (!local_rqfpr || !local_rqfcr) {
pr_err("Out of memory\n");
ret = 0;
goto err;
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/ibm/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,10 +1921,8 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
u64 hret;

ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
if (!ehea_mcl_entry) {
pr_err("no mem for mcl_entry\n");
if (!ehea_mcl_entry)
return;
}

INIT_LIST_HEAD(&ehea_mcl_entry->list);

Expand Down
19 changes: 6 additions & 13 deletions trunk/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,
}

queue->queue_length = nr_of_pages * pagesize;
queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
if (!queue->queue_pages) {
pr_err("no mem for queue_pages\n");
queue->queue_pages = kmalloc_array(nr_of_pages, sizeof(void *),
GFP_KERNEL);
if (!queue->queue_pages)
return -ENOMEM;
}

/*
* allocate pages for queue:
Expand Down Expand Up @@ -129,10 +128,8 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter,
void *vpage;

cq = kzalloc(sizeof(*cq), GFP_KERNEL);
if (!cq) {
pr_err("no mem for cq\n");
if (!cq)
goto out_nomem;
}

cq->attr.max_nr_of_cqes = nr_of_cqe;
cq->attr.cq_token = cq_token;
Expand Down Expand Up @@ -257,10 +254,8 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
struct ehea_eq *eq;

eq = kzalloc(sizeof(*eq), GFP_KERNEL);
if (!eq) {
pr_err("no mem for eq\n");
if (!eq)
return NULL;
}

eq->adapter = adapter;
eq->attr.type = type;
Expand Down Expand Up @@ -428,10 +423,8 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter,


qp = kzalloc(sizeof(*qp), GFP_KERNEL);
if (!qp) {
pr_err("no mem for qp\n");
if (!qp)
return NULL;
}

qp->adapter = adapter;

Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/net/ethernet/ibm/emac/mal.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,9 @@ static int mal_probe(struct platform_device *ofdev)
irq_handler_t hdlr_serr, hdlr_txde, hdlr_rxde;

mal = kzalloc(sizeof(struct mal_instance), GFP_KERNEL);
if (!mal) {
printk(KERN_ERR
"mal%d: out of memory allocating MAL structure!\n",
index);
if (!mal)
return -ENOMEM;
}

mal->index = index;
mal->ofdev = ofdev;
mal->version = of_device_is_compatible(ofdev->dev.of_node, "ibm,mcmal2") ? 2 : 1;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/ibm/ibmveth.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ static int ibmveth_open(struct net_device *netdev)
adapter->bounce_buffer =
kmalloc(netdev->mtu + IBMVETH_BUFF_OH, GFP_KERNEL);
if (!adapter->bounce_buffer) {
netdev_err(netdev, "unable to allocate bounce buffer\n");
rc = -ENOMEM;
goto err_out_free_irq;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2671,9 +2671,8 @@ static int igb_sw_init(struct igb_adapter *adapter)
igb_init_queue_configuration(adapter);

/* Setup and initialize a copy of the hw vlan table array */
adapter->shadow_vfta = kzalloc(sizeof(u32) *
E1000_VLAN_FILTER_TBL_SIZE,
GFP_ATOMIC);
adapter->shadow_vfta = kcalloc(E1000_VLAN_FILTER_TBL_SIZE, sizeof(u32),
GFP_ATOMIC);

/* This call may decrease the number of queues */
if (igb_init_interrupt_scheme(adapter, true)) {
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/ethernet/intel/igbvf/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,12 +1399,10 @@ static void igbvf_set_multi(struct net_device *netdev)
int i;

if (!netdev_mc_empty(netdev)) {
mta_list = kmalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
if (!mta_list) {
dev_err(&adapter->pdev->dev,
"failed to allocate multicast filter list\n");
mta_list = kmalloc_array(netdev_mc_count(netdev), ETH_ALEN,
GFP_ATOMIC);
if (!mta_list)
return;
}
}

/* prepare a packed array of only addresses. */
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,12 +1879,10 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index)
memset(rxq->rx_desc_area, 0, size);

rxq->rx_desc_area_size = size;
rxq->rx_skb = kmalloc(rxq->rx_ring_size * sizeof(*rxq->rx_skb),
GFP_KERNEL);
if (rxq->rx_skb == NULL) {
netdev_err(mp->dev, "can't allocate rx skb ring\n");
rxq->rx_skb = kmalloc_array(rxq->rx_ring_size, sizeof(*rxq->rx_skb),
GFP_KERNEL);
if (rxq->rx_skb == NULL)
goto out_free;
}

rx_desc = rxq->rx_desc_area;
for (i = 0; i < rxq->rx_ring_size; i++) {
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/marvell/mvmdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ static int orion_mdio_probe(struct platform_device *pdev)

bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
if (!bus->irq) {
dev_err(&pdev->dev, "Cannot allocate PHY IRQ array\n");
mdiobus_free(bus);
return -ENOMEM;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/ethernet/marvell/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -3916,10 +3916,9 @@ static int skge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* space for skge@pci:0000:04:00.0 */
hw = kzalloc(sizeof(*hw) + strlen(DRV_NAME "@pci:")
+ strlen(pci_name(pdev)) + 1, GFP_KERNEL);
if (!hw) {
dev_err(&pdev->dev, "cannot allocate hardware struct\n");
if (!hw)
goto err_out_free_regions;
}

sprintf(hw->irq_name, DRV_NAME "@pci:%s", pci_name(pdev));

hw->pdev = pdev;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4969,10 +4969,8 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

hw = kzalloc(sizeof(*hw) + strlen(DRV_NAME "@pci:")
+ strlen(pci_name(pdev)) + 1, GFP_KERNEL);
if (!hw) {
dev_err(&pdev->dev, "cannot allocate hardware struct\n");
if (!hw)
goto err_out_free_regions;
}

hw->pdev = pdev;
sprintf(hw->irq_name, DRV_NAME "@pci:%s", pci_name(pdev));
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/mellanox/mlx4/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,8 @@ static void *mlx4_en_add(struct mlx4_dev *dev)

printk_once(KERN_INFO "%s", mlx4_en_version);

mdev = kzalloc(sizeof *mdev, GFP_KERNEL);
mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
if (!mdev) {
dev_err(&dev->pdev->dev, "Device struct alloc failed, "
"aborting.\n");
err = -ENOMEM;
goto err_free_res;
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,10 +2054,8 @@ static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
/* Allow large DMA segments, up to the firmware limit of 1 GB */
dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024);

priv = kzalloc(sizeof *priv, GFP_KERNEL);
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(&pdev->dev, "Device struct alloc failed, "
"aborting.\n");
err = -ENOMEM;
goto err_release_regions;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,9 @@ static int myri10ge_adopt_running_firmware(struct myri10ge_priv *mgp)
/* copy header of running firmware from SRAM to host memory to
* validate firmware */
hdr = kmalloc(bytes, GFP_KERNEL);
if (hdr == NULL) {
dev_err(dev, "could not malloc firmware hdr\n");
if (hdr == NULL)
return -ENOMEM;
}

memcpy_fromio(hdr, mgp->sram + hdr_offset, bytes);
status = myri10ge_validate_firmware(mgp, hdr);
kfree(hdr);
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,8 @@ netxen_setup_minidump(struct netxen_adapter *adapter)
adapter->mdump.md_template =
kmalloc(adapter->mdump.md_template_size, GFP_KERNEL);

if (!adapter->mdump.md_template) {
dev_err(&adapter->pdev->dev, "Unable to allocate memory "
"for minidump template.\n");
if (!adapter->mdump.md_template)
return -ENOMEM;
}

err = netxen_get_minidump_template(adapter);
if (err) {
Expand Down
18 changes: 5 additions & 13 deletions trunk/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,11 +670,9 @@ static int nx_p3_nic_add_mac(struct netxen_adapter *adapter,
}

cur = kzalloc(sizeof(nx_mac_list_t), GFP_ATOMIC);
if (cur == NULL) {
printk(KERN_ERR "%s: failed to add mac address filter\n",
adapter->netdev->name);
if (cur == NULL)
return -ENOMEM;
}

memcpy(cur->mac_addr, addr, ETH_ALEN);
list_add_tail(&cur->list, &adapter->mac_list);
return nx_p3_sre_macaddr_change(adapter,
Expand Down Expand Up @@ -2568,16 +2566,10 @@ netxen_dump_fw(struct netxen_adapter *adapter)
adapter->mdump.md_capture_size;
if (!adapter->mdump.md_capture_buff) {
adapter->mdump.md_capture_buff =
vmalloc(adapter->mdump.md_dump_size);
if (!adapter->mdump.md_capture_buff) {
dev_info(&adapter->pdev->dev,
"Unable to allocate memory for minidump "
"capture_buffer(%d bytes).\n",
adapter->mdump.md_dump_size);
vzalloc(adapter->mdump.md_dump_size);
if (!adapter->mdump.md_capture_buff)
return;
}
memset(adapter->mdump.md_capture_buff, 0,
adapter->mdump.md_dump_size);

if (netxen_collect_minidump(adapter)) {
adapter->mdump.has_valid_dump = 0;
adapter->mdump.md_dump_size = 0;
Expand Down
Loading

0 comments on commit 6842566

Please sign in to comment.