[alsa-devel] [PATCH] soundwire: bus: set initial value to port_status
![](https://secure.gravatar.com/avatar/1f3d34808c5f863f3f587f9b6a4c0291.jpg?s=120&d=mm&r=g)
From: Bard Liao yung-chuan.liao@linux.intel.com
port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized.
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com --- drivers/soundwire/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index f6a1e4b4813d..33f41b3e642e 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -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;
![](https://secure.gravatar.com/avatar/59bffa8d29505a5951521a2fd09a4fd9.jpg?s=120&d=mm&r=g)
On 8/29/19 1:11 PM, Bard liao wrote:
From: Bard Liao yung-chuan.liao@linux.intel.com
port_status[port_num] are assigned for each port_num in some if conditions. So some of the port_status may not be initialized.
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com
drivers/soundwire/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index f6a1e4b4813d..33f41b3e642e 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -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;
![](https://secure.gravatar.com/avatar/722e39d3e216d4853d437fd35b87d9f2.jpg?s=120&d=mm&r=g)
On 30-08-19, 02:11, Bard liao wrote:
From: Bard Liao yung-chuan.liao@linux.intel.com
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
participants (3)
-
Bard liao
-
Pierre-Louis Bossart
-
Vinod Koul