diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-06-14 10:03:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-06-15 13:46:43 +0300 |
commit | 97c5209b3d374a25ebdb4c2ea9e9c1b121768da0 (patch) | |
tree | 8057d251bf4f16320575c35e17861baccdafd686 | |
parent | f0ec58d557d65838974035ffd8a8862cf8166a81 (diff) | |
download | linux-97c5209b3d374a25ebdb4c2ea9e9c1b121768da0.tar.xz |
leds: trigger: netdev: uninitialized variable in netdev_trig_activate()
The qca8k_cled_hw_control_get() function which implements ->hw_control_get
sets the appropriate bits but does not clear them. This leads to an
uninitialized variable bug. Fix this by setting mode to zero at the
start.
Fixes: e0256648c831 ("net: dsa: qca8k: implement hw_control ops")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Lee Jones <lee@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/leds/trigger/ledtrig-netdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index b0a6f2749552..2311dae7f070 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -445,7 +445,7 @@ static void netdev_trig_work(struct work_struct *work) static int netdev_trig_activate(struct led_classdev *led_cdev) { struct led_netdev_data *trigger_data; - unsigned long mode; + unsigned long mode = 0; struct device *dev; int rc; |