net: mvpp2: Use field just assigned in error test
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 14:18:19 +0000 (15:18 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:57 +0000 (15:47 +0200)
commitc6561a467c9f9a77717ddc2ef296866a4d8a6843
tree955f04fd78eec7cbe594602fb1105896067bb994
parent3aa3d37282414ea5c19ea415f46d214f4c80d8b6
net: mvpp2: Use field just assigned in error test

In mvpp2_probe the code attempts to get a value for "gop-port-id" and
assigns it to port->gop_id but it then tests port->id for being equal to
-1. That is an impossible test as port->id is a field of type u8 so
cannot be negative. Change the test to port->gop_id.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/mvpp2.c