From patchwork Mon Sep 3 11:07:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 145786 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2355589ljw; Mon, 3 Sep 2018 04:10:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZt3pocP0xt5wWGS4SnFjKpwvJoeoixmudJOXBAyPmLrLLGSDiTQTFw4zj4rHla7AGnq1OW X-Received: by 2002:adf:fe8d:: with SMTP id l13-v6mr18172664wrr.164.1535973025936; Mon, 03 Sep 2018 04:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535973025; cv=none; d=google.com; s=arc-20160816; b=crFttDBmmgFpm4rRIiZVMEfvfC2cITSHqDudcaaSB3wS5uN2jhULv05S7qMJHKK5mh AqSkg99YSRYPqFyP3Bcb3g+LD2G8JmslnQoGSKN2ajghYQrEcmFRFqU6EV3WOS4Yzw/k Gr7R3ItE0+L9vsYavlcfPzO72QGGvUJ39Na8D1xOvdwPFWm+CPTT+zIUW67yaNa1bPKN 1S8zLt7NP6Ha3WKbnAq0Ya4cdZpSIl0Pl7vd0uzNPRruDux/8yV3PD0dGe0YKv7Wj0ks k/JUeqAFca7fMYwYQLEBrZ/DniP69fj1DzT5BZ3dJC156IeowuBhy10GYdpgYGy1Cmeb wKLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to; bh=FQSZYuW9jBjC61gCwogDeFPvaI57KEa7eNpMW8v8Q4M=; b=qEQgARaedR8D3aXjIcOV90kgWYQmxTw0ipJOzqsvuIlFkmk71cYFM/QVa1EYnWx9AH dcv2mKagSz1MmgXo5AC0vBaSQdk+cspUIWb4h2Xvk0w10I0RHdqfomV4PLedNn2tWnyI Cxf30+IK/K9Hg+4Oo8PYSsWAeCnOnd2SMPsXq+1idkiauzR2uTm5JLdpwx+xgnvErqMO E257L3IHWWsWGPhNpFBixd3ul1RrkVebgmLnJDJam10mIsbXIcLojZpU+vg2707JefNI 79FlT+S6RMC2t1ekgwCMnjNYxwSqkds66vFvV1VXsYvUR8tDMTaOamrFj3MR7kHE2Yfa okHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="CBlRtS/2"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id o16-v6si8172710wmh.19.2018.09.03.04.10.25; Mon, 03 Sep 2018 04:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="CBlRtS/2"; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0213D2676C9; Mon, 3 Sep 2018 13:10:25 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id B717026777B; Mon, 3 Sep 2018 13:10:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by alsa0.perex.cz (Postfix) with ESMTP id 5D2C52673F4 for ; Mon, 3 Sep 2018 13:10:18 +0200 (CEST) Received: by mail-wr1-f66.google.com with SMTP id g33-v6so270582wrd.1 for ; Mon, 03 Sep 2018 04:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3Iwcl00YGBnlbvpZZDajvdQimSyfWjbafvjQtZcgtzA=; b=CBlRtS/2PFYRllExbrHVMGJVgxoaJaOOoKcuVaQ19boiu6sbctc9CVWY8CbMjV9lNH qaS3cS2pBMCbaIkngQOtW0U4TA/5OTJ0ZqIyqMmuCRh8HPqXF7ZB+017TYdoRDy5yFBc XqRpVhS4RDV9j8me3ke9lf88Cx7ulVl58pukc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3Iwcl00YGBnlbvpZZDajvdQimSyfWjbafvjQtZcgtzA=; b=ayorV83syTNl+Tp10nxytiY3kBqf7kX+CResTIIsh2s6jDrvU+aA/liN7ewHCZEH0z Or3+fWOmgFqYHaHJp79Cz21SG1lHXjTYEfYoHX7iemIxR+N7Ux4g1AI+Sz7Z+7LjGvNm orpkNgG7P+KCkXn3GMe2C56KD+O9faLa30wavd/HhJmt8mfC2gZ6i79fYap3XtPFJoOY F3ClPivVr5qvKMsAeH0bP6Dvn5mOwWq6RcNnNQ+q0xPXAmd2WNKBGGdVUHHhj/QfnddI 4gdhp7HZby0UlUxlX9slRosyHI4QhasAgdo74lEXMGx0wdCF0KQdJ2Dbxuo/aX405rdg 2r1w== X-Gm-Message-State: APzg51CDuTS9YUYLPPBBVCd8SpXhycRc8/LWqPWga7qgSwbQW5ax1Cy1 q5OEUTTwVefuikcPz7945n5pRQ== X-Received: by 2002:a5d:6aca:: with SMTP id u10-v6mr19548651wrw.44.1535973017735; Mon, 03 Sep 2018 04:10:17 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id o3-v6sm13861423wrn.58.2018.09.03.04.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Sep 2018 04:10:17 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, alsa-devel@alsa-project.org Date: Mon, 3 Sep 2018 12:07:47 +0100 Message-Id: <20180903110747.10745-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.18.0 Cc: Srinivas Kandagatla , bgoswami@codeaurora.org, rohitkr@codeaurora.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: q6routing: initialize data correctly X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org Some of the router data fields are left as default zeros which are valid dai ids, so initialize these to invalid value of -1. Without intializing these correctly get_session_from_id() can return incorrect session resulting in not closing the opened copp and messing up with the copp ref count. Fixes: e3a33673e845 ("ASoC: qdsp6: q6routing: Add q6routing driver") Signed-off-by: Srinivas Kandagatla --- sound/soc/qcom/qdsp6/q6routing.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.18.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index dc94c5c53788..c6b51571be94 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -960,8 +960,10 @@ static int msm_routing_probe(struct snd_soc_component *c) { int i; - for (i = 0; i < MAX_SESSIONS; i++) + for (i = 0; i < MAX_SESSIONS; i++) { routing_data->sessions[i].port_id = -1; + routing_data->sessions[i].fedai_id = -1; + } return 0; }