net: ipa: more completely check endpoint validity
authorAlex Elder <elder@linaro.org>
Thu, 27 Oct 2022 12:26:29 +0000 (07:26 -0500)
committerJakub Kicinski <kuba@kernel.org>
Sat, 29 Oct 2022 05:06:47 +0000 (22:06 -0700)
commit2b87d721999a7591af7a63c1908084b1d59ba4e5
treed1cfac953dbcd68fd61faca50285be2274d509fa
parentbd5524930ba7c9ed914952da48a77f803f0b5011
net: ipa: more completely check endpoint validity

Ensure all defined TX endpoints are in the range [0, CONS_PIPES) and
defined RX endpoints are within [PROD_LOWEST, PROD_LOWEST+PROD_PIPES).

Modify the way local variables are used to make the checks easier
to understand.  Check for each endpoint being in valid range in the
loop, and drop the logical-AND check of initialized against
unavailable IDs.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_endpoint.c