Skip to contentSkip to conversation

soundwire: bus: set initial value to port_status

PATCH Applied Bard liao 3 participants 3 messages Aug 29, 2019 – Sep 4, 2019 SoundWire

lore
Share & tools
lore

Bard liao

author maintainer
#0 lore raw

PATCH 1/1 soundwire: bus: set initial value to port_status

From: Bard Liao <[email protected]>

port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized.

---
 drivers/soundwire/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/bus.c +1 -1
index f6a1e4b4813d..33f41b3e642e 100644
@@ -835,7 +835,7 @@ static int sdw_handle_port_interrupt(struct sdw_slave *slave,
 static int sdw_handle_slave_alerts(struct sdw_slave *slave)
 {
 	struct sdw_slave_intr_status slave_intr;
-	u8 clear = 0, bit, port_status[15];
+	u8 clear = 0, bit, port_status[15] = {0};
 	int port_num, stat, ret, count = 0;
 	unsigned long port;
 	bool slave_notify = false;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Bard liao

From: Bard Liao <[email protected]>

port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized.

Quoted 19 lines
---
  drivers/soundwire/bus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soundwire/bus.c +1 -1
index f6a1e4b4813d..33f41b3e642e 100644
@@ -835,7 +835,7 @@ static int sdw_handle_port_interrupt(struct sdw_slave *slave,
  static int sdw_handle_slave_alerts(struct sdw_slave *slave)
  {
  	struct sdw_slave_intr_status slave_intr;
-	u8 clear = 0, bit, port_status[15];
+	u8 clear = 0, bit, port_status[15] = {0};
  	int port_num, stat, ret, count = 0;
  	unsigned long port;
  	bool slave_notify = false;
maintainer Applied
#2 lore raw
In reply to Bard liao
Quoted 4 lines · Bard liao

From: Bard Liao <[email protected]>

port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized.

Applied, thanks

Signature · 1 line
~Vinod