Эх сурвалжийг харах

ehea: Fixed possible nullpointer access

Fixed possible nullpointer access in event queue processing

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Thomas Klein 18 жил өмнө
parent
commit
41b69c7051

+ 3 - 2
drivers/net/ehea/ehea_main.c

@@ -575,8 +575,9 @@ static struct ehea_port *ehea_get_port(struct ehea_adapter *adapter,
 	int i;
 	int i;
 
 
 	for (i = 0; i < adapter->num_ports; i++)
 	for (i = 0; i < adapter->num_ports; i++)
-		if (adapter->port[i]->logical_port_id == logical_port)
-			return adapter->port[i];
+		if (adapter->port[i])
+	                if (adapter->port[i]->logical_port_id == logical_port)
+				return adapter->port[i];
 	return NULL;
 	return NULL;
 }
 }