Addition of a separate if_indices_reason array broke reallocation
failure checking. drv->if_indices or drv->if_indices_reason could not be
NULL in the place where this check was moved to. Fix that by maintaining
knowledge of reallocation failure in a separate local variable.
Fixes: 732b1d20ec06 ("nl80211: Clean up ifidx properly if interface in a bridge is removed")
Signed-off-by: Jouni Malinen <j@w1.fi>
{
int i;
int *old, *old_reason;
+ int alloc_failed = 0;
wpa_printf(MSG_DEBUG,
"nl80211: Add own interface ifindex %d (ifidx_reason %d)",
drv->if_indices = drv->default_if_indices;
else
drv->if_indices = old;
+ alloc_failed = 1;
}
if (!drv->if_indices_reason) {
if (!old_reason)
drv->if_indices_reason = drv->default_if_indices_reason;
else
drv->if_indices_reason = old_reason;
+ alloc_failed = 1;
}
- if (!drv->if_indices || !drv->if_indices_reason) {
+ if (alloc_failed) {
wpa_printf(MSG_ERROR, "Failed to reallocate memory for "
"interfaces");
wpa_printf(MSG_ERROR, "Ignoring EAPOL on interface %d", ifidx);