Skip to content

Commit

Permalink
cfg80211: Remove unnecessary ksize() call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Buesch authored and John W. Linville committed May 6, 2009
1 parent 90ccda9 commit 273de92
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 273de92

Please sign in to comment.