Skip to contentSkip to conversation

hostap_ap.c:hostap_add_sta(): inconsequent NULL checking

PATCH In review Adrian Bunk 2 participants 2 messages Mar 10, 2006 – Mar 13, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hostap_ap.c:hostap_add_sta(): inconsequent NULL checking

The Coverity checker spotted this inconsequent NULL checking (unconditionally dereferencing directly after checking for NULL isn't a good idea).

drivers/net/wireless/hostap/hostap_ap.c renamed from drivers/net/wireless/hostap/hostap_ap.c.old +1 -1
@@ -3141,7 +3141,7 @@ int hostap_add_sta(struct ap_data *ap, u
 	if (ret == 1) {
 		sta = ap_add_sta(ap, sta_addr);
 		if (!sta)
-			ret = -1;
+			return -1;
 		sta->flags = WLAN_STA_AUTH | WLAN_STA_ASSOC;
 		sta->ap = 1;
 		memset(sta->supported_rates, 0, sizeof(sta->supported_rates));
#1 lore raw
Quoted 3 lines · Adrian Bunk

The Coverity checker spotted this inconsequent NULL checking (unconditionally dereferencing directly after checking for NULL isn't a good idea).

Thanks! Added to my queue for wireless-2.6.

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA