]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cfg80211: Remove unnecessary ksize() call
authorMichael Buesch <mb@bu3sch.de>
Sat, 25 Apr 2009 20:28:55 +0000 (22:28 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 May 2009 19:14:42 +0000 (15:14 -0400)
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 <mb@bu3sch.de>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/scan.c

index 723aeb3d9462b915f2292593637fb90ac5eef9de..5dd909a4e601c7e5cdb68589532d013c75c74206 100644 (file)
@@ -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) {