[IPV4] ip_options.c: kmalloc + memset conversion to kzalloc
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Tue, 31 Jul 2007 21:06:45 +0000 (14:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Jul 2007 21:06:45 +0000 (14:06 -0700)
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_options.c

index 2513468..2f14745 100644 (file)
@@ -513,11 +513,8 @@ void ip_options_undo(struct ip_options * opt)
 
 static struct ip_options *ip_options_get_alloc(const int optlen)
 {
-       struct ip_options *opt = kmalloc(sizeof(*opt) + ((optlen + 3) & ~3),
-                                        GFP_KERNEL);
-       if (opt)
-               memset(opt, 0, sizeof(*opt));
-       return opt;
+       return kzalloc(sizeof(struct ip_options) + ((optlen + 3) & ~3),
+                      GFP_KERNEL);
 }
 
 static int ip_options_get_finish(struct ip_options **optp,