Subject: [2.6 patch] hostap_ap.c:hostap_add_sta(): inconsequent NULL checking

From: Adrian Bunk <[email-masked]>
Date: Fri, 10 Mar 2006 20:10:26 +0100

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-masked]>

--- linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_ap.c.old	2006-03-10 19:30:08.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/drivers/net/wireless/hostap/hostap_ap.c	2006-03-10 19:30:43.000000000 +0100
@@ -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));