753-net-next-net-dsa-qca8k-remove-redundant-check-in-parse_port_config.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. From b9133f3ef5a2659730cf47a74bd0a9259f1cf8ff Mon Sep 17 00:00:00 2001
  2. From: Ansuel Smith <[email protected]>
  3. Date: Mon, 22 Nov 2021 16:23:40 +0100
  4. Subject: net: dsa: qca8k: remove redundant check in parse_port_config
  5. The very next check for port 0 and 6 already makes sure we don't go out
  6. of bounds with the ports_config delay table.
  7. Remove the redundant check.
  8. Reported-by: kernel test robot <[email protected]>
  9. Reported-by: Dan Carpenter <[email protected]>
  10. Signed-off-by: Ansuel Smith <[email protected]>
  11. Reviewed-by: Vladimir Oltean <[email protected]>
  12. Signed-off-by: David S. Miller <[email protected]>
  13. ---
  14. drivers/net/dsa/qca8k.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
  17. index a429c9750add1..bfffc1fb7016d 100644
  18. --- a/drivers/net/dsa/qca8k.c
  19. +++ b/drivers/net/dsa/qca8k.c
  20. @@ -983,7 +983,7 @@ qca8k_parse_port_config(struct qca8k_priv *priv)
  21. u32 delay;
  22. /* We have 2 CPU port. Check them */
  23. - for (port = 0; port < QCA8K_NUM_PORTS && cpu_port_index < QCA8K_NUM_CPU_PORTS; port++) {
  24. + for (port = 0; port < QCA8K_NUM_PORTS; port++) {
  25. /* Skip every other port */
  26. if (port != 0 && port != 6)
  27. continue;
  28. --
  29. cgit 1.2.3-1.el7