Skip to content

Commit

Permalink
Staging: ozwpan: Change kmalloc() to kzalloc()
Browse files Browse the repository at this point in the history
changing to kzalloc lets us get rid of some lines. The other concern
here is that some members of binding->ptype are still uninitialized at
the end of the function.

Signed-off-by: Salym Senyonga <salymsash@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Salym Senyonga authored and Greg Kroah-Hartman committed Feb 7, 2014
1 parent a44755d commit e4b41af
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/staging/ozwpan/ozproto.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void oz_binding_add(const char *net_dev)
{
struct oz_binding *binding;

binding = kmalloc(sizeof(struct oz_binding), GFP_KERNEL);
binding = kzalloc(sizeof(struct oz_binding), GFP_KERNEL);
if (!binding)
return;

Expand All @@ -679,10 +679,6 @@ void oz_binding_add(const char *net_dev)
kfree(binding);
return;
}
} else {
oz_dbg(ON, "Binding to all netcards\n");
memset(binding->name, 0, OZ_MAX_BINDING_LEN);
binding->ptype.dev = NULL;
}
dev_add_pack(&binding->ptype);
spin_lock_bh(&g_binding_lock);
Expand Down

0 comments on commit e4b41af

Please sign in to comment.