提交 2f1f6229 编写于 作者: P Paul Jakma 提交者: Yang Yingliang

NIU: fix incorrect error return, missed in previous revert

stable inclusion
from linux-4.19.201
commit 4cd2534cbf6f5986682c12f4a6881fb2fe065e50

--------------------------------

commit 15bbf8bb upstream.

Commit 7930742d, reverting 26fd962b, missed out on reverting an incorrect
change to a return value.  The niu_pci_vpd_scan_props(..) == 1 case appears
to be a normal path - treating it as an error and return -EINVAL was
breaking VPD_SCAN and causing the driver to fail to load.

Fix, so my Neptune card works again.

Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Shannon Nelson <shannon.lee.nelson@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable <stable@vger.kernel.org>
Fixes: 7930742d ('Revert "niu: fix missing checks of niu_pci_eeprom_read"')
Signed-off-by: NPaul Jakma <paul@jakma.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 bc508ec8
...@@ -8192,8 +8192,9 @@ static int niu_pci_vpd_fetch(struct niu *np, u32 start) ...@@ -8192,8 +8192,9 @@ static int niu_pci_vpd_fetch(struct niu *np, u32 start)
err = niu_pci_vpd_scan_props(np, here, end); err = niu_pci_vpd_scan_props(np, here, end);
if (err < 0) if (err < 0)
return err; return err;
/* ret == 1 is not an error */
if (err == 1) if (err == 1)
return -EINVAL; return 0;
} }
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册