net: dsa: qca8k: return with -EINVAL on invalid port
Subsystems (4)
PATCH 1/1 net: dsa: qca8k: return with -EINVAL on invalid port
Currently an invalid port throws a WARN_ON warning however invalid uninitialized values in reg and cpu_port_index are being used later on. Fix this by returning -EINVAL for an invalid port value.
Addresses clang-scan warnings:drivers/net/dsa/qca8k.c:1981:3: warning: 2nd function call argument is an
uninitialized value [core.CallAndMessage]drivers/net/dsa/qca8k.c:1999:9: warning: 2nd function call argument is an
uninitialized value [core.CallAndMessage]
--- drivers/net/dsa/qca8k.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/dsa/qca8k.c +1 -0
@@ -1937,6 +1937,7 @@ static int qca8k_pcs_config(struct phylink_pcs *pcs, unsigned int mode,default :WARN_ON (1 ); +return -EINVAL ; }/* Enable/disable SerDes auto-negotiation as necessary */
Signature · 1 line
2.34.1
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 24 Feb 2022 22:05:57 +0000 you wrote:
Currently an invalid port throws a
WARN_ONwarning however invalid uninitialized values in reg andcpu_port_indexare being used later on. Fix this by returning-EINVALfor an invalid port value.Addresses clang-scan warnings:
drivers/net/dsa/qca8k.c:1981:3: warning: 2nd function call argument is an
uninitialized value [core.CallAndMessage]drivers/net/dsa/qca8k.c:1999:9: warning: 2nd function call argument is an
uninitialized value [core.CallAndMessage][...]
Here is the summary with links:
- [next] net: dsa: qca8k: return with -EINVAL on invalid port
https://git.kernel.org/netdev/net-next/c/38455fbcc8ec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html