| From 27b1be5f42234916d7a59766c44972c4e0635d91 Mon Sep 17 00:00:00 2001 |
| From: Bard Liao <yung-chuan.liao@linux.intel.com> |
| Date: Fri, 30 Aug 2019 02:11:35 +0800 |
| Subject: [PATCH] soundwire: bus: set initial value to port_status |
| |
| commit f1fac63af678b2fc1044ca71fedf1f2ae8bf7c3b upstream. |
| |
| 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> |
| Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> |
| Link: https://lore.kernel.org/r/20190829181135.16049-1-yung-chuan.liao@linux.intel.com |
| Signed-off-by: Vinod Koul <vkoul@kernel.org> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c |
| index aac35fc3cf22..eece65510845 100644 |
| --- a/drivers/soundwire/bus.c |
| +++ b/drivers/soundwire/bus.c |
| @@ -803,7 +803,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; |
| -- |
| 2.7.4 |
| |