P2P: Fix removal_reason setting to use correct pointer

The previous version triggered a NULL pointer dereference on
P2P_GROUP_REMOVE * command.
This commit is contained in:
Jouni Malinen 2010-10-27 11:47:41 +03:00 committed by Jouni Malinen
parent c926593119
commit 58e54293db

View file

@ -2807,7 +2807,7 @@ int wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname)
while (wpa_s) {
prev = wpa_s;
wpa_s = wpa_s->next;
wpa_s->removal_reason = P2P_GROUP_REMOVAL_REQUESTED;
prev->removal_reason = P2P_GROUP_REMOVAL_REQUESTED;
wpas_p2p_group_delete(prev);
}
return 0;