2020-07-13 13:47:29

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 4/14 v3] iwlegacy: Check the return value of pcie_capability_read_*()

+ linux-wireless

Saheed Olayemi Bolarinwa <[email protected]> writes:

> From: Bolarinwa Olayemi Saheed <[email protected]>
>
> Cc: [email protected],
> [email protected],
> [email protected],
> [email protected],
> [email protected],
> Stanislaw Gruszka <[email protected]>,
> [email protected],
> [email protected]
>
> On failure pcie_capability_read_dword() sets it's last parameter, val
> to 0. However, with Patch 14/14, it is possible that val is set to ~0 on
> failure. This would introduce a bug because (x & x) == (~0 & x).
>
> This bug can be avoided without changing the function's behaviour if the
> return value of pcie_capability_read_dword is checked to confirm success.
>
> Check the return value of pcie_capability_read_dword() to ensure success.
>
> Suggested-by: Bjorn Helgaas <[email protected]>
> Signed-off-by: Bolarinwa Olayemi Saheed <[email protected]>

Please check your setup, linux-wireless was not in Cc field.

--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


2020-07-13 17:03:04

by Saheed O. Bolarinwa

[permalink] [raw]
Subject: Re: [PATCH 4/14 v3] iwlegacy: Check the return value of pcie_capability_read_*()

Fixed

On 7/13/20 3:44 PM, Kalle Valo wrote:
> + linux-wireless
>
> Saheed Olayemi Bolarinwa <[email protected]> writes:
>
>> From: Bolarinwa Olayemi Saheed <[email protected]>
>>
>> Cc: [email protected],
>> [email protected],
>> [email protected],
>> [email protected],
>> [email protected],
>> Stanislaw Gruszka <[email protected]>,
>> [email protected],
>> [email protected]
>>
>> On failure pcie_capability_read_dword() sets it's last parameter, val
>> to 0. However, with Patch 14/14, it is possible that val is set to ~0 on
>> failure. This would introduce a bug because (x & x) == (~0 & x).
>>
>> This bug can be avoided without changing the function's behaviour if the
>> return value of pcie_capability_read_dword is checked to confirm success.
>>
>> Check the return value of pcie_capability_read_dword() to ensure success.
>>
>> Suggested-by: Bjorn Helgaas <[email protected]>
>> Signed-off-by: Bolarinwa Olayemi Saheed <[email protected]>
> Please check your setup, linux-wireless was not in Cc field.
>
Thank you for letting me know. I have fixed it and resent to the missing
addresses.