From: Markus Elfring Date: Wed, 4 Feb 2015 19:06:39 +0000 (+0100) Subject: hostap: Delete an unnecessary check before the function call "kfree" X-Git-Tag: v4.14-rc1~5989^2~10^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f24fe305986afcb9eb2bde1031798b3b2ebf649;p=platform%2Fkernel%2Flinux-rpi.git hostap: Delete an unnecessary check before the function call "kfree" 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 5965255..fd8d83d 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c @@ -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 */