[Linux-kernel-mentees] [PATCH 3/14 v3] ath9k: Check the return value of pcie_capability_read_*()

Kalle Valo kvalo at codeaurora.org
Mon Jul 20 17:09:51 UTC 2020

"Saheed O. Bolarinwa" <refactormyself at gmail.com> wrote:

> 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 <bjorn at helgaas.com>
> Signed-off-by: Bolarinwa Olayemi Saheed <refactormyself at gmail.com>
> Signed-off-by: Kalle Valo <kvalo at codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

9a8ab2bfb678 ath9k: Check the return value of pcie_capability_read_*()



More information about the Linux-kernel-mentees mailing list