Skip to content

Commit

Permalink
[IPV4] ip_options.c: kmalloc + memset conversion to kzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Mariusz Kozlowski <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Mariusz Kozlowski authored and davem330 committed Jul 31, 2007
1 parent f879665 commit 3764070
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions net/ipv4/ip_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3764070

Please sign in to comment.