[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <5dff3719-f827-45b6-a0d3-a00efed1099b@moroto.mountain>
Date: Mon, 12 Jun 2023 10:20:55 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, 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>,
Pavel Machek <pavel@....cz>, netdev@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH net-XXX] net: dsa: qca8k: uninitialized variable in
hw_control_get()
The caller, netdev_trig_activate(), passes an uninitialized value for
*rules. This function sets bits to one but it doesn't zero out any
bits so there is a potential for uninitialized data to be used.
Zero out the *rules at the start of the function.
Fixes: e0256648c831 ("net: dsa: qca8k: implement hw_control ops")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/net/dsa/qca/qca8k-leds.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/dsa/qca/qca8k-leds.c b/drivers/net/dsa/qca/qca8k-leds.c
index 6f02029b454b..772478156e4e 100644
--- a/drivers/net/dsa/qca/qca8k-leds.c
+++ b/drivers/net/dsa/qca/qca8k-leds.c
@@ -304,6 +304,8 @@ qca8k_cled_hw_control_get(struct led_classdev *ldev, unsigned long *rules)
u32 val;
int ret;
+ *rules = 0;
+
/* With hw control not active return err */
if (!qca8k_cled_hw_control_status(ldev))
return -EINVAL;
--
2.39.2
Powered by blists - more mailing lists