From patchwork Mon Nov 13 11:12:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 10055609 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A03636029B for ; Mon, 13 Nov 2017 11:13:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA3932937E for ; Mon, 13 Nov 2017 11:13:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EBB529387; Mon, 13 Nov 2017 11:13:25 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no 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 D54FD2937E for ; Mon, 13 Nov 2017 11:13:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6B4FF26732C; Mon, 13 Nov 2017 12:13:09 +0100 (CET) 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 76265267327; Mon, 13 Nov 2017 12:13:06 +0100 (CET) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by alsa0.perex.cz (Postfix) with ESMTP id 73980267326 for ; Mon, 13 Nov 2017 12:13:03 +0100 (CET) Received: by mail-lf0-f65.google.com with SMTP id f125so17821930lff.4 for ; Mon, 13 Nov 2017 03:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=3Oxoyz0tvYwm7ik3B/sJNOJBn9dKYHk9Y0QNkcJWCUY=; b=gzUfEF+Y1WbDDCE3yc+3idhalNOI+XErhODCFJ9PpWRZqRNKnLMoYQxdq7defQJV1B O0qSETqXeKh6vGjyyAsKT8RKLbyyuovoFZD3wdjDzVC5DLMkxSRd8EjErLKuLsTV7s+f eNN8StOOvIx+JzLPHUHYI64/21tSiAzlWe72S6FFCi1iByB58r4jRKhiVC9MXCos+fXe M4d4UVsTeiwlnpM+7AeuYB03Mls0PFWjV3GeO0xLg5s1JNWg1diJfLHlemrS8IiVCCA7 lz0U4aphhOpxk2GnNXS26RJPTgKKNmtc/15X+JNjpQQHVGe25OZoJXhrPOodjcy1468O sjzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=3Oxoyz0tvYwm7ik3B/sJNOJBn9dKYHk9Y0QNkcJWCUY=; b=ArnBmO1SSQqDDl5GaLMEGaXi2AeaGjCSxJG6eZOrNoK7oVrUSZXmVNQbOfl9I4LGbt y2SKWXnzz+2FLKWcnmHX7UoEwZaraAFOBlHHipEpyOvFaTNurYsBuyYA62dGYbTjXxWj BT5rtrnFaU4ZB8oIBbNUYczLq3fyFbPwVymN43BPuyBC/OE5pb9yQoq177FCHTjVjRHf rxs9Q9M4Aa4RBYrowV0q1Nn0+DFCX00s4m2gG7X6ilgAqPMQXp01v3PL1leYa8Rq2pvm pQvy3Qv+Ny6nj2W9QpZ6QOJCvCb/I1BGSQDM2eFB2Sao9Re40ssgeB7VCSsCUmXUcmq2 Owmg== X-Gm-Message-State: AJaThX6l5R+1hLoe7x9/gIgasy4IGXDZOb6XIFSqWxqhD0bMSNG6c2s0 El2eoOK8lD85EXVIJlMGM0U= X-Google-Smtp-Source: AGs4zMaQNNyG7bfWfOErAVmpsyVBe0AbOwXFrAj8icuBFOo7lalrJ6ZWJTj81FV6fnDsR+auwxy+QA== X-Received: by 10.46.67.129 with SMTP id z1mr1805479lje.124.1510571582448; Mon, 13 Nov 2017 03:13:02 -0800 (PST) Received: from xi.terra (c-c0bae655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.186.192]) by smtp.gmail.com with ESMTPSA id t81sm2816227lff.84.2017.11.13.03.13.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 03:13:01 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.89) (envelope-from ) id 1eECfs-0006I7-0P; Mon, 13 Nov 2017 12:13:08 +0100 From: Johan Hovold To: Mark Brown Date: Mon, 13 Nov 2017 12:12:55 +0100 Message-Id: <20171113111256.24140-1-johan@kernel.org> X-Mailer: git-send-email 2.15.0 Cc: alsa-devel@alsa-project.org, Support Opensource , Liam Girdwood , linux-kernel@vger.kernel.org, Takashi Iwai , stable , Peter Ujfalusi , Johan Hovold , Adam Thomson Subject: [alsa-devel] [PATCH 1/2] ASoC: da7218: fix fix child-node lookup 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 Fix child-node lookup during probe, which ended up searching the whole device tree depth-first starting at the parent rather than just matching on its children. To make things worse, the parent codec node was also prematurely freed. Fixes: 4d50934abd22 ("ASoC: da7218: Add da7218 codec driver") Cc: stable # 4.5 Cc: Adam Thomson Signed-off-by: Johan Hovold Acked-by: Adam Thomson --- sound/soc/codecs/da7218.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/da7218.c b/sound/soc/codecs/da7218.c index b2d42ec1dcd9..56564ce90cb6 100644 --- a/sound/soc/codecs/da7218.c +++ b/sound/soc/codecs/da7218.c @@ -2520,7 +2520,7 @@ static struct da7218_pdata *da7218_of_to_pdata(struct snd_soc_codec *codec) } if (da7218->dev_id == DA7218_DEV_ID) { - hpldet_np = of_find_node_by_name(np, "da7218_hpldet"); + hpldet_np = of_get_child_by_name(np, "da7218_hpldet"); if (!hpldet_np) return pdata;