On Sat, 2009-04-25 at 22:28 +0200, Michael Buesch wrote: > 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@xxxxxxxxx> Good catch, thanks. Reviewed-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> johannes > --- > net/wireless/scan.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > --- wireless-testing.orig/net/wireless/scan.c > +++ wireless-testing/net/wireless/scan.c > @@ -384,11 +384,9 @@ cfg80211_bss_update(struct cfg80211_regi > } 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) { >
Attachment:
signature.asc
Description: This is a digitally signed message part