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: 10585769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A298513AC for ; Mon, 3 Sep 2018 11:10:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9386A294F0 for ; Mon, 3 Sep 2018 11:10:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 862BF29609; Mon, 3 Sep 2018 11:10:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 318A9294F0 for ; Mon, 3 Sep 2018 11:10:28 +0000 (UTC) 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) 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-Google-Smtp-Source: ANB0VdYMlFjdvu52xVAsFJ1GzZOpYejhIvC0dBF7Pz5csI+WJzd2CJZbKNu1lxVUZn3q2lpaBzWotg== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }