Staging: ozwpan: Change kmalloc() to kzalloc()
authorSalym Senyonga <salymsash@gmail.com>
Sat, 25 Jan 2014 09:54:41 +0000 (12:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 18:59:38 +0000 (10:59 -0800)
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>
drivers/staging/ozwpan/ozproto.c

index c303ae144083cb554595e27481d7bfa9be9d89fc..e7138ed325dda09fa8e1e9b34122af88fd32bf5c 100644 (file)
@@ -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;
 
@@ -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);