[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241009212319.1045176-1-aryan.srivastava@alliedtelesis.co.nz>
Date: Thu, 10 Oct 2024 10:23:19 +1300
From: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
To: Andrew Lunn <andrew@...n.ch>
Cc: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next v0] net: dsa: mv88e6xxx: Fix uninitialised err value
The err value in mv88e6xxx_region_atu_snapshot is now potentially
uninitialised on return. Initialise err as 0.
Fixes: ada5c3229b32 ("net: dsa: mv88e6xxx: Add FID map cache")
Signed-off-by: Aryan Srivastava <aryan.srivastava@...iedtelesis.co.nz>
---
drivers/net/dsa/mv88e6xxx/devlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/devlink.c b/drivers/net/dsa/mv88e6xxx/devlink.c
index ef3643bc43db..795c8df7b6a7 100644
--- a/drivers/net/dsa/mv88e6xxx/devlink.c
+++ b/drivers/net/dsa/mv88e6xxx/devlink.c
@@ -376,7 +376,7 @@ static int mv88e6xxx_region_atu_snapshot(struct devlink *dl,
struct dsa_switch *ds = dsa_devlink_to_ds(dl);
struct mv88e6xxx_devlink_atu_entry *table;
struct mv88e6xxx_chip *chip = ds->priv;
- int fid = -1, count, err;
+ int fid = -1, err = 0, count;
table = kmalloc_array(mv88e6xxx_num_databases(chip),
sizeof(struct mv88e6xxx_devlink_atu_entry),
--
2.46.0
Powered by blists - more mailing lists