From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bard liao Subject: [PATCH] soundwire: bus: set initial value to port_status Date: Fri, 30 Aug 2019 02:11:35 +0800 Message-ID: <20190829181135.16049-1-yung-chuan.liao@linux.intel.com> Return-path: Sender: linux-kernel-owner@vger.kernel.org To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com, vkoul@kernel.org, gregkh@linuxfoundation.org, Blauciak@alsa-project.org, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.org From: Bard Liao 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 --- 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; -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D3EC3A5A3 for ; Fri, 30 Aug 2019 06:10:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B7632186A for ; Fri, 30 Aug 2019 06:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lU73vDr2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B7632186A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 700EF857; Fri, 30 Aug 2019 08:10:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 700EF857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1567145455; bh=5ofIIf8R1RVTI6psUgSGoEHhWRz7oGRF8iK1FPq4QD4=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=lU73vDr2ksGOlNC+pqOteyGIy8BjGRaBAGWHrG2xS4kcHyE33RefHsLnhj7krehG/ dpAamVM0w194wweRWQuBVXZk9I/LAwghldPc22sm2GEeb6EBi3rXmyBkdkfyK2y3F/ iXGYH9KvcVMi0MUCSRKKZC3PYO+/0VmHKO92lDk0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F23B2F800D1; Fri, 30 Aug 2019 08:10:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D0355F80369; Fri, 30 Aug 2019 08:10:03 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C9C7BF800D1; Fri, 30 Aug 2019 08:09:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C9C7BF800D1 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2019 23:09:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,445,1559545200"; d="scan'208";a="172141707" Received: from bard-ubuntu.sh.intel.com ([10.239.13.33]) by orsmga007.jf.intel.com with ESMTP; 29 Aug 2019 23:09:54 -0700 From: Bard liao To: alsa-devel@alsa-project.org Date: Fri, 30 Aug 2019 02:11:35 +0800 Message-Id: <20190829181135.16049-1-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.17.1 Cc: tiwai@suse.de, gregkh@linuxfoundation.org, Blauciak@alsa-project.org, pierre-louis.bossart@linux.intel.com, linux-kernel@vger.kernel.org, vkoul@kernel.org, broonie@kernel.org, bard.liao@intel.com Subject: [alsa-devel] [PATCH] soundwire: bus: set initial value to port_status X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Message-ID: <20190829181135.twwNMq9Jw1yuqjrPRRQ3ISUgdA6_uiUkcizZyANXciU@z> From: Bard Liao 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 --- 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; -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel