]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: return directly from dsa_to_port
authorVivien Didelot <vivien.didelot@gmail.com>
Fri, 25 Oct 2019 18:48:53 +0000 (14:48 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Oct 2019 19:07:49 +0000 (12:07 -0700)
commitaf2f59d9a9705b397fbd0ae809b153a4bea05c12
tree86c282a61aa3a8b9c1859b25592c6cbb7a550414
parent38d27953cf808204b9f8d991d6e4c43a389d8ee6
net: dsa: return directly from dsa_to_port

Return directly from within the loop as soon as the port is found,
otherwise we won't return NULL if the end of the list is reached.

Fixes: 285e59b0f428 ("net: dsa: use ports list in dsa_to_port")
Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dsa.h