]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[PATCH] hostap: Fix ap_add_sta() return value verification
authorAdrian Bunk <bunk@stusta.de>
Mon, 20 Mar 2006 03:21:45 +0000 (19:21 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 23 Mar 2006 21:16:57 +0000 (16:16 -0500)
The Coverity checker (CID: 273) spotted this inconsequent NULL checking
(unconditionally dereferencing directly after checking for NULL
isn't a good idea). Return immediately to avoid this.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/hostap/hostap_ap.c

index 753a1de6664bba6f8a90972a3ba13be751f20ec6..06c3fa32b310e41e0af0eea71fbf9fabf6a66a89 100644 (file)
@@ -3141,7 +3141,7 @@ int hostap_add_sta(struct ap_data *ap, u8 *sta_addr)
        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));