Message ID | DUB123-W2663266CEA8296935E9450A0B30@phx.gbl |
---|---|
State | Awaiting Upstream, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 90cff58..7ee0913 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -810,6 +810,11 @@ bool batadv_gw_out_of_range(struct batadv_priv *bat_priv, goto out; gw_node = batadv_gw_node_get(bat_priv, orig_dst_node); + + /* gw_node can be NULL. We need to check before dereferencing */ + if (gw_node == NULL) + goto out; + if (!gw_node->bandwidth_down == 0) goto out;