]> git.baikalelectronics.ru Git - kernel.git/commit
staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check
authorPetr Štetiar <ynezz@true.cz>
Mon, 6 May 2019 21:24:46 +0000 (23:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 19:22:47 +0000 (12:22 -0700)
commit7a0d3c8df8bb493b455f75b4f3e414d873b9ab3b
tree7967fac3890f76195303c85af63e9dfd0e4d56f1
parenta7f8c1d8732c2ee0bf12e4b441d6acf4297903bb
staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check

Commit 40a8b1f8943c ("staging: octeon-ethernet: support
of_get_mac_address new ERR_PTR error") has introduced checking for
ERR_PTR encoded error value from of_get_mac_address with IS_ERR macro,
which is not sufficient in this case, as the mac variable is set to NULL
initialy and if the kernel is compiled without DT support this NULL
would get passed to IS_ERR, which would lead to the wrong decision and
would pass that NULL pointer and invalid MAC address further.

Fixes: 40a8b1f8943c ("staging: octeon-ethernet: support of_get_mac_address new ERR_PTR error")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/staging/octeon/ethernet.c