staging: octeon: validate interface before calling INDEX
authorAaro Koskinen <aaro.koskinen@nokia.com>
Wed, 29 Jun 2016 12:20:44 +0000 (15:20 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Aug 2016 16:02:32 +0000 (18:02 +0200)
commit0ad1ed99d6ce86bc76b8768a49a65155281aad44
treed3766698d7c8b0748d74303955e888a810b999b5
parent473256b0aea4e69a99afb21c9243e5cd544ac9ad
staging: octeon: validate interface before calling INDEX

Some helper functions call INDEX before checking if the interface is
valid. Since pow0 is not a real interface, we get the following errors:

cvmx_helper_get_interface_index_num: Illegal IPD port number

Fix by using INDEX only when needed with real interfaces.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon/ethernet.c