On Wed, Jul 08, 2020 at 12:03:13AM +0200, Saheed Olayemi Bolarinwa wrote: > From: Bolarinwa Olayemi Saheed <refactormys...@gmail.com> > > On failure pcie_capability_read_dword() sets it's last parameter, val > to 0. In which case (val & PCI_EXP_DEVCTL2_LTR_EN) evaluates to 0. > However, with Patch 13/13, 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_word is checked to confirm success. > > Check the return value of pcie_capability_read_word() to ensure success. > > Suggested-by: Bjorn Helgaas <bj...@helgaas.com> > Signed-off-by: Bolarinwa Olayemi Saheed <refactormys...@gmail.com>
Acked-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>