[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1433183947-13095-2-git-send-email-sfeldma@gmail.com>
Date: Mon, 1 Jun 2015 11:39:02 -0700
From: sfeldma@...il.com
To: netdev@...r.kernel.org
Cc: jiri@...nulli.us, simon.horman@...ronome.com
Subject: [PATCH net-next 1/5] rocker: zero allocate ports array
From: Scott Feldman <sfeldma@...il.com>
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@...il.com>
---
drivers/net/ethernet/rocker/rocker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 36f7edf..ab6d871 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4936,7 +4936,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++) {
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists