niu: fix missing checks of niu_pci_eeprom_read
commit4d6b5b08f19fe697f45f1d8962af3fc5867e421c
authorKangjie Lu <kjlu@umn.edu>
Tue, 25 Dec 2018 07:56:14 +0000 (25 01:56 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:47:17 +0000 (12 19:47 +0100)
tree2d752ea0adacc421cf0058d178a45909ff2099b0
parent1e480ee6c0eba3e69d099b6284bcf5b78bae26d9
niu: fix missing checks of niu_pci_eeprom_read

[ Upstream commit 26fd962bde0b15e54234fe762d86bc0349df1de4 ]

niu_pci_eeprom_read() may fail, so we should check its return value
before using the read data.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Acked-by: Shannon Nelson <shannon.lee.nelson@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sun/niu.c