From: Michael Buesch Date: Sat, 25 Apr 2009 20:28:55 +0000 (+0200) Subject: cfg80211: Remove unnecessary ksize() call X-Git-Tag: v2.6.31-rc1~330^2~448^2~48 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=273de92c8461776aaac7b32f8d5889a72b38ea10;p=~shefty%2Frdma-dev.git cfg80211: Remove unnecessary ksize() call This removes an unnecessary ksize() call. krealloc() will do this test internally and won't perform any allocation if the space is already sufficient to hold the data. So remove the redundant check. Signed-off-by: Michael Buesch Reviewed-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 723aeb3d946..5dd909a4e60 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -384,11 +384,9 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, } else { u8 *ies = found->pub.information_elements; - if (found->ies_allocated) { - if (ksize(ies) < ielen) - ies = krealloc(ies, ielen, - GFP_ATOMIC); - } else + if (found->ies_allocated) + ies = krealloc(ies, ielen, GFP_ATOMIC); + else ies = kmalloc(ielen, GFP_ATOMIC); if (ies) {