diff options
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 69cbe8a66d02..f9ca63912fbf 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -287,10 +287,9 @@ fl_create(struct in6_flowlabel_req *freq, char __user *optval, int optlen, int * | |||
287 | int err; | 287 | int err; |
288 | 288 | ||
289 | err = -ENOMEM; | 289 | err = -ENOMEM; |
290 | fl = kmalloc(sizeof(*fl), GFP_KERNEL); | 290 | fl = kzalloc(sizeof(*fl), GFP_KERNEL); |
291 | if (fl == NULL) | 291 | if (fl == NULL) |
292 | goto done; | 292 | goto done; |
293 | memset(fl, 0, sizeof(*fl)); | ||
294 | 293 | ||
295 | olen = optlen - CMSG_ALIGN(sizeof(*freq)); | 294 | olen = optlen - CMSG_ALIGN(sizeof(*freq)); |
296 | if (olen > 0) { | 295 | if (olen > 0) { |
@@ -663,7 +662,7 @@ static int ip6fl_seq_open(struct inode *inode, struct file *file) | |||
663 | { | 662 | { |
664 | struct seq_file *seq; | 663 | struct seq_file *seq; |
665 | int rc = -ENOMEM; | 664 | int rc = -ENOMEM; |
666 | struct ip6fl_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); | 665 | struct ip6fl_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL); |
667 | 666 | ||
668 | if (!s) | 667 | if (!s) |
669 | goto out; | 668 | goto out; |
@@ -674,7 +673,6 @@ static int ip6fl_seq_open(struct inode *inode, struct file *file) | |||
674 | 673 | ||
675 | seq = file->private_data; | 674 | seq = file->private_data; |
676 | seq->private = s; | 675 | seq->private = s; |
677 | memset(s, 0, sizeof(*s)); | ||
678 | out: | 676 | out: |
679 | return rc; | 677 | return rc; |
680 | out_kfree: | 678 | out_kfree: |