Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d2e7a5c authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

wireless: Remove unnecessary alloc/OOM messages, alloc cleanups



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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9d11bd15
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);
+1 −3
Original line number Diff line number Diff line
@@ -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__);

+3 −3
Original line number Diff line number Diff line
@@ -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);

+2 −3
Original line number Diff line number Diff line
@@ -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);
+3 −6
Original line number Diff line number Diff line
@@ -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),
	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;
	}
Loading