hostap: Delete an unnecessary check before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 4 Feb 2015 19:06:39 +0000 (20:06 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 6 Feb 2015 06:51:35 +0000 (08:51 +0200)
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/hostap/hostap_ap.c

index 596525528f50504afe3005d98ac0ab47d3e26453..fd8d83dd4f62ab09b22126c4b330af1ef9b571d9 100644 (file)
@@ -145,7 +145,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)
        if (sta->aid > 0)
                ap->sta_aid[sta->aid - 1] = NULL;
 
-       if (!sta->ap && sta->u.sta.challenge)
+       if (!sta->ap)
                kfree(sta->u.sta.challenge);
        del_timer_sync(&sta->timer);
 #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */