diff options
Diffstat (limited to 'drivers/net/iseries_veth.c')
-rw-r--r-- | drivers/net/iseries_veth.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index 347d50cd77d4..0433c41f9029 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -822,10 +822,9 @@ static int veth_init_connection(u8 rlp) | |||
822 | || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) | 822 | || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) ) |
823 | return 0; | 823 | return 0; |
824 | 824 | ||
825 | cnx = kmalloc(sizeof(*cnx), GFP_KERNEL); | 825 | cnx = kzalloc(sizeof(*cnx), GFP_KERNEL); |
826 | if (! cnx) | 826 | if (! cnx) |
827 | return -ENOMEM; | 827 | return -ENOMEM; |
828 | memset(cnx, 0, sizeof(*cnx)); | ||
829 | 828 | ||
830 | cnx->remote_lp = rlp; | 829 | cnx->remote_lp = rlp; |
831 | spin_lock_init(&cnx->lock); | 830 | spin_lock_init(&cnx->lock); |
@@ -852,14 +851,13 @@ static int veth_init_connection(u8 rlp) | |||
852 | if (rc != 0) | 851 | if (rc != 0) |
853 | return rc; | 852 | return rc; |
854 | 853 | ||
855 | msgs = kmalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL); | 854 | msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL); |
856 | if (! msgs) { | 855 | if (! msgs) { |
857 | veth_error("Can't allocate buffers for LPAR %d.\n", rlp); | 856 | veth_error("Can't allocate buffers for LPAR %d.\n", rlp); |
858 | return -ENOMEM; | 857 | return -ENOMEM; |
859 | } | 858 | } |
860 | 859 | ||
861 | cnx->msgs = msgs; | 860 | cnx->msgs = msgs; |
862 | memset(msgs, 0, VETH_NUMBUFFERS * sizeof(struct veth_msg)); | ||
863 | 861 | ||
864 | for (i = 0; i < VETH_NUMBUFFERS; i++) { | 862 | for (i = 0; i < VETH_NUMBUFFERS; i++) { |
865 | msgs[i].token = i; | 863 | msgs[i].token = i; |