diff options
Diffstat (limited to 'net/ipv4/igmp.c')
| -rw-r--r-- | net/ipv4/igmp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index d299c8e547d6..9f4b752f5a33 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
| @@ -1028,10 +1028,9 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) | |||
| 1028 | * for deleted items allows change reports to use common code with | 1028 | * for deleted items allows change reports to use common code with |
| 1029 | * non-deleted or query-response MCA's. | 1029 | * non-deleted or query-response MCA's. |
| 1030 | */ | 1030 | */ |
| 1031 | pmc = kmalloc(sizeof(*pmc), GFP_KERNEL); | 1031 | pmc = kzalloc(sizeof(*pmc), GFP_KERNEL); |
| 1032 | if (!pmc) | 1032 | if (!pmc) |
| 1033 | return; | 1033 | return; |
| 1034 | memset(pmc, 0, sizeof(*pmc)); | ||
| 1035 | spin_lock_bh(&im->lock); | 1034 | spin_lock_bh(&im->lock); |
| 1036 | pmc->interface = im->interface; | 1035 | pmc->interface = im->interface; |
| 1037 | in_dev_hold(in_dev); | 1036 | in_dev_hold(in_dev); |
| @@ -1529,10 +1528,9 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, | |||
| 1529 | psf_prev = psf; | 1528 | psf_prev = psf; |
| 1530 | } | 1529 | } |
| 1531 | if (!psf) { | 1530 | if (!psf) { |
| 1532 | psf = kmalloc(sizeof(*psf), GFP_ATOMIC); | 1531 | psf = kzalloc(sizeof(*psf), GFP_ATOMIC); |
| 1533 | if (!psf) | 1532 | if (!psf) |
| 1534 | return -ENOBUFS; | 1533 | return -ENOBUFS; |
| 1535 | memset(psf, 0, sizeof(*psf)); | ||
| 1536 | psf->sf_inaddr = *psfsrc; | 1534 | psf->sf_inaddr = *psfsrc; |
| 1537 | if (psf_prev) { | 1535 | if (psf_prev) { |
| 1538 | psf_prev->sf_next = psf; | 1536 | psf_prev->sf_next = psf; |
| @@ -2380,7 +2378,7 @@ static int igmp_mc_seq_open(struct inode *inode, struct file *file) | |||
| 2380 | { | 2378 | { |
| 2381 | struct seq_file *seq; | 2379 | struct seq_file *seq; |
| 2382 | int rc = -ENOMEM; | 2380 | int rc = -ENOMEM; |
| 2383 | struct igmp_mc_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); | 2381 | struct igmp_mc_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); |
| 2384 | 2382 | ||
| 2385 | if (!s) | 2383 | if (!s) |
| 2386 | goto out; | 2384 | goto out; |
| @@ -2390,7 +2388,6 @@ static int igmp_mc_seq_open(struct inode *inode, struct file *file) | |||
| 2390 | 2388 | ||
| 2391 | seq = file->private_data; | 2389 | seq = file->private_data; |
| 2392 | seq->private = s; | 2390 | seq->private = s; |
| 2393 | memset(s, 0, sizeof(*s)); | ||
| 2394 | out: | 2391 | out: |
| 2395 | return rc; | 2392 | return rc; |
| 2396 | out_kfree: | 2393 | out_kfree: |
| @@ -2555,7 +2552,7 @@ static int igmp_mcf_seq_open(struct inode *inode, struct file *file) | |||
| 2555 | { | 2552 | { |
| 2556 | struct seq_file *seq; | 2553 | struct seq_file *seq; |
| 2557 | int rc = -ENOMEM; | 2554 | int rc = -ENOMEM; |
| 2558 | struct igmp_mcf_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); | 2555 | struct igmp_mcf_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); |
| 2559 | 2556 | ||
| 2560 | if (!s) | 2557 | if (!s) |
| 2561 | goto out; | 2558 | goto out; |
| @@ -2565,7 +2562,6 @@ static int igmp_mcf_seq_open(struct inode *inode, struct file *file) | |||
| 2565 | 2562 | ||
| 2566 | seq = file->private_data; | 2563 | seq = file->private_data; |
| 2567 | seq->private = s; | 2564 | seq->private = s; |
| 2568 | memset(s, 0, sizeof(*s)); | ||
| 2569 | out: | 2565 | out: |
| 2570 | return rc; | 2566 | return rc; |
| 2571 | out_kfree: | 2567 | out_kfree: |
