niu: fix missing checks of niu_pci_eeprom_read
authorKangjie Lu <kjlu@umn.edu>
Tue, 25 Dec 2018 07:56:14 +0000 (01:56 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:44:58 +0000 (19:44 +0100)
commit63e311153b66fb36eb448e65b8bca5c1dbf1c28e
tree0205b5d61e782b36f79cfd9834d2cd00d6c541f6
parent5eb9de20b9cc44e58ae83ec37a8791814d37a1ce
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