Search Linux Wireless

Re: [PATCH] b43: N-PHY: handle allocation fail in samples generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



W dniu 5 lutego 2010 18:34 użytkownik Gábor Stefanik
<netrolller.3d@xxxxxxxxx> napisał:
> 2010/2/4 Rafał Miłecki <zajec5@xxxxxxxxx>:
>> Signed-off-by: Rafał Miłecki <zajec5@xxxxxxxxx>
>> ---
>>  drivers/net/wireless/b43/phy_n.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 074b34c..795bb1e 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -1069,6 +1069,10 @@ static u16 b43_nphy_gen_load_samples(struct b43_wldev *dev, u32 freq, u16 max,
>>        }
>>
>>        samples = kzalloc(len * sizeof(struct b43_c32), GFP_KERNEL);
>> +       if (!samples) {
>> +               b43err(dev->wl, "allocation for samples generation failed\n");
>> +               return 0;
>
> return -ENOMEM;

Function was somehow designed to return unsigned only. Returning 0
means error (see place where we call b43_nphy_gen_load_samples, we
check result for 0 there.

Is that OK then?

>> +       }
>>        rot = (((freq * 36) / bw) << 16) / 100;
>>        angle = 0;
>>
>> --
>> 1.6.4.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
>
>
> --
> Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
>



-- 
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux