netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] net: dsa: qca8k: return with -EINVAL on invalid port
@ 2022-02-24 22:05 Colin Ian King
  2022-02-26  6:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-02-24 22:05 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S . Miller, Jakub Kicinski, Nathan Chancellor,
	Nick Desaulniers, Russell King, netdev
  Cc: kernel-janitors, linux-kernel, llvm

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]

Fixes: 7544b3ff745b ("net: dsa: qca8k: move pcs configuration")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/dsa/qca8k.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 04fa21e37dfa..2ed45f69b8e4 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -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 */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] net: dsa: qca8k: return with -EINVAL on invalid port
  2022-02-24 22:05 [PATCH][next] net: dsa: qca8k: return with -EINVAL on invalid port Colin Ian King
@ 2022-02-26  6:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-02-26  6:30 UTC (permalink / raw)
  To: Colin Ian King
  Cc: andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba, nathan,
	ndesaulniers, rmk+kernel, netdev, kernel-janitors, linux-kernel,
	llvm

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 24 Feb 2022 22:05:57 +0000 you wrote:
> 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]
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-26  6:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 22:05 [PATCH][next] net: dsa: qca8k: return with -EINVAL on invalid port Colin Ian King
2022-02-26  6:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).