hostap_ap.c:hostap_add_sta(): inconsequent NULL checking
Subsystems (3)
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).
Signed-off-by Adrian Bunk <[email protected]>
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, uif (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));
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