Commit 97c5209b authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: e0256648 ("net: dsa: qca8k: implement hw_control ops")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0ec58d5
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment