瀏覽代碼

[IPV4] ip_options.c: kmalloc + memset conversion to kzalloc

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Mariusz Kozlowski 18 年之前
父節點
當前提交
376407039c
共有 1 個文件被更改,包括 2 次插入5 次删除
  1. 2 5
      net/ipv4/ip_options.c

+ 2 - 5
net/ipv4/ip_options.c

@@ -513,11 +513,8 @@ void ip_options_undo(struct ip_options * opt)
 
 
 static struct ip_options *ip_options_get_alloc(const int optlen)
 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,
 static int ip_options_get_finish(struct ip_options **optp,