aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/gemini/patches-4.14/0904-net-cortina-fix-uninitialized-struct-member-usage.patch
blob: 15a2d6cd895b5c055404648ef70d815e5f61b5a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -1013,9 +1013,9 @@ static int geth_resize_freeq(struct gemi
 	int ret;
 
 	if (netdev->dev_id == 0)
-		other_netdev = geth->port1->netdev;
+		other_netdev = (geth->port1)? geth->port1->netdev : NULL;
 	else
-		other_netdev = geth->port0->netdev;
+		other_netdev = (geth->port0)? geth->port0->netdev : NULL;
 
 	if (other_netdev && netif_running(other_netdev))
 		return -EBUSY;
@@ -2510,6 +2510,8 @@ static int gemini_ethernet_probe(struct
 	if (IS_ERR(geth->base))
 		return PTR_ERR(geth->base);
 	geth->dev = dev;
+	geth->port0 = NULL;
+	geth->port1 = NULL;
 
 	/* Wait for ports to stabilize */
 	do {