switch_vlan_config *c;
int j, u, p, s;
- c = kmalloc(sizeof(switch_vlan_config), GFP_KERNEL);
+ c = kzalloc(sizeof(switch_vlan_config), GFP_KERNEL);
if (!c)
return NULL;
- memset(c, 0, sizeof(switch_vlan_config));
while (isspace(*buf)) buf++;
j = 0;
while (isspace(*buf)) buf++;
}
- if (*buf != 0) return NULL;
+ if (*buf != 0) {
+ kfree(c);
+ return NULL;
+ }
c->port &= (1 << driver->ports) - 1;
c->untag &= (1 << driver->ports) - 1;