mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] net/tap: use xzalloc to allocate data
Date: Thu, 20 Sep 2012 07:36:43 +0200	[thread overview]
Message-ID: <1348119406-17464-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1348119406-17464-1-git-send-email-plagnioj@jcrosoft.com>

this will ensure the data are set to 0 (list as example)

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/net/tap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 5c3a1e3..d5c7031 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -76,7 +76,7 @@ int tap_probe(struct device_d *dev)
 	struct tap_priv *priv;
 	int ret = 0;
 
-	priv = xmalloc(sizeof(struct tap_priv));
+	priv = xzalloc(sizeof(struct tap_priv));
 	priv->name = "barebox";
 
 	priv->fd = tap_alloc(priv->name);
@@ -85,7 +85,7 @@ int tap_probe(struct device_d *dev)
 		goto out;
 	}
 
-	edev = xmalloc(sizeof(struct eth_device));
+	edev = xzalloc(sizeof(struct eth_device));
 	edev->priv = priv;
 	edev->parent = dev;
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-09-20  5:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20  5:34 [PATCH 0/6 v3] sandbox fix + bus Jean-Christophe PLAGNIOL-VILLARD
2012-09-20  5:36 ` [PATCH 1/6] sandbox: check only image option in the second getopt Jean-Christophe PLAGNIOL-VILLARD
2012-09-20  5:36   ` [PATCH 2/6] sandbox: do not register device before barebox is started Jean-Christophe PLAGNIOL-VILLARD
2012-09-20  5:36   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-09-20  5:36   ` [PATCH 4/6] driver: register bus Jean-Christophe PLAGNIOL-VILLARD
2012-09-20  5:36   ` [PATCH 5/6] driver: search device and driver based on the bus instead of all Jean-Christophe PLAGNIOL-VILLARD
2012-09-20  5:36   ` [PATCH 6/6] switch all platform_bus device/driver registering to platform_driver/device_register Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 21:16 ` [PATCH 0/6 v3] sandbox fix + bus Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348119406-17464-3-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox