summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/rocker
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-06-01 11:39:02 -0700
committerDavid S. Miller <davem@davemloft.net>2015-06-01 17:00:08 -0700
commit27b808cbc2ad72608fb2fd9abd81930d32464546 (patch)
tree2d5891cfb91eaaabbcf68e561dcad2dc22da24f6 /drivers/net/ethernet/rocker
parent66e5133f19e901a044fa5eaeeb6ecff4545839e5 (diff)
downloadtalos-op-linux-27b808cbc2ad72608fb2fd9abd81930d32464546.tar.gz
talos-op-linux-27b808cbc2ad72608fb2fd9abd81930d32464546.zip
rocker: zero allocate ports array
When allocating the array of rocker port pointers, zero the array values so we can test for !NULL to see if port is allocated/registered. We'll need this later when installing untagged VLAN support for each port, during port probe. It's a long story, but to install a VLAN (vid=0 for untagged, in this case) on a port, we'll need to scan other ports to see if the VLAN group for that VLAN has been setup. To scan the other ports, we need to walk the port array. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/rocker')
-rw-r--r--drivers/net/ethernet/rocker/rocker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index d246647b3653..b0fb24509124 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4911,7 +4911,7 @@ static int rocker_probe_ports(struct rocker *rocker)
int err;
alloc_size = sizeof(struct rocker_port *) * rocker->port_count;
- rocker->ports = kmalloc(alloc_size, GFP_KERNEL);
+ rocker->ports = kzalloc(alloc_size, GFP_KERNEL);
if (!rocker->ports)
return -ENOMEM;
for (i = 0; i < rocker->port_count; i++) {
OpenPOWER on IntegriCloud