diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/wanrouter/wanmain.c | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wanrouter/wanmain.c')
-rw-r--r-- | net/wanrouter/wanmain.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c index ad8e8a79779..9479659277a 100644 --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c | |||
@@ -642,18 +642,16 @@ static int wanrouter_device_new_if(struct wan_device *wandev, | |||
642 | 642 | ||
643 | if (cnf->config_id == WANCONFIG_MPPP) { | 643 | if (cnf->config_id == WANCONFIG_MPPP) { |
644 | #ifdef CONFIG_WANPIPE_MULTPPP | 644 | #ifdef CONFIG_WANPIPE_MULTPPP |
645 | pppdev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); | 645 | pppdev = kzalloc(sizeof(struct ppp_device), GFP_KERNEL); |
646 | err = -ENOBUFS; | 646 | err = -ENOBUFS; |
647 | if (pppdev == NULL) | 647 | if (pppdev == NULL) |
648 | goto out; | 648 | goto out; |
649 | memset(pppdev, 0, sizeof(struct ppp_device)); | 649 | pppdev->dev = kzalloc(sizeof(struct net_device), GFP_KERNEL); |
650 | pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); | ||
651 | if (pppdev->dev == NULL) { | 650 | if (pppdev->dev == NULL) { |
652 | kfree(pppdev); | 651 | kfree(pppdev); |
653 | err = -ENOBUFS; | 652 | err = -ENOBUFS; |
654 | goto out; | 653 | goto out; |
655 | } | 654 | } |
656 | memset(pppdev->dev, 0, sizeof(struct net_device)); | ||
657 | err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf); | 655 | err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf); |
658 | dev = pppdev->dev; | 656 | dev = pppdev->dev; |
659 | #else | 657 | #else |
@@ -663,11 +661,10 @@ static int wanrouter_device_new_if(struct wan_device *wandev, | |||
663 | goto out; | 661 | goto out; |
664 | #endif | 662 | #endif |
665 | } else { | 663 | } else { |
666 | dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); | 664 | dev = kzalloc(sizeof(struct net_device), GFP_KERNEL); |
667 | err = -ENOBUFS; | 665 | err = -ENOBUFS; |
668 | if (dev == NULL) | 666 | if (dev == NULL) |
669 | goto out; | 667 | goto out; |
670 | memset(dev, 0, sizeof(struct net_device)); | ||
671 | err = wandev->new_if(wandev, dev, cnf); | 668 | err = wandev->new_if(wandev, dev, cnf); |
672 | } | 669 | } |
673 | 670 | ||