* [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return
@ 2016-04-25 22:11 Colin King
2016-04-26 1:24 ` Vivien Didelot
2016-04-28 20:29 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2016-04-25 22:11 UTC (permalink / raw)
To: David S . Miller, Vivien Didelot, Andrew Lunn, netdev; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The error return err is not initialized and there is a possibility
that err is not assigned causing mv88e6xxx_port_bridge_join to
return a garbage error return status. Fix this by initializing err
to 0.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/dsa/mv88e6xxx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index 028f92f..98d3cfb 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -2207,7 +2207,7 @@ int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- int i, err;
+ int i, err = 0;
mutex_lock(&ps->smi_mutex);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return
2016-04-25 22:11 [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return Colin King
@ 2016-04-26 1:24 ` Vivien Didelot
2016-04-28 20:29 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Vivien Didelot @ 2016-04-26 1:24 UTC (permalink / raw)
To: Colin King, David S . Miller, Andrew Lunn, netdev
Cc: linux-kernel, Geert Uytterhoeven
Hi Colin,
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> The error return err is not initialized and there is a possibility
> that err is not assigned causing mv88e6xxx_port_bridge_join to
> return a garbage error return status. Fix this by initializing err
> to 0.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Even though that cannot happen, the fix doesn't hurt.
Adding Geert in the loop who submitted an RFC for this first:
https://lkml.org/lkml/2016/4/25/95
Thanks,
Vivien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return
2016-04-25 22:11 [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return Colin King
2016-04-26 1:24 ` Vivien Didelot
@ 2016-04-28 20:29 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-04-28 20:29 UTC (permalink / raw)
To: colin.king; +Cc: vivien.didelot, andrew, netdev, linux-kernel
From: Colin King <colin.king@canonical.com>
Date: Mon, 25 Apr 2016 23:11:22 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> The error return err is not initialized and there is a possibility
> that err is not assigned causing mv88e6xxx_port_bridge_join to
> return a garbage error return status. Fix this by initializing err
> to 0.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-28 20:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 22:11 [PATCH] net: dsa: mv88e6xxx: fix uninitialized error return Colin King
2016-04-26 1:24 ` Vivien Didelot
2016-04-28 20:29 ` David Miller
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).