Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2750721imj; Mon, 18 Feb 2019 11:29:37 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib1HJzyqEj0KPkP8ANdYkW11kz5SIhviTD2Y1lKHjNmzi+XhXJAg8+lalt/YPcdxZ/FAi2j X-Received: by 2002:a62:7042:: with SMTP id l63mr25400120pfc.1.1550518176982; Mon, 18 Feb 2019 11:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550518176; cv=none; d=google.com; s=arc-20160816; b=SHzmiLFLFpQEIUipYXnzlEETYFY/ozVEHv2tUwGd7tCwtyvSTBUazqqR7oshqYT33j eR6p61CDGo4NR9B9lQWNX3aORsOojc9iHhi3vj9I860jzSha0dXJ7Cm1A76Ma1lNuEGV 5Ug76W57b0gqpa7nUc3yob56S38i/h7jpkOrG/13pcXHA5zSuMJZoRRqBAY2aXR5tVmQ 4nbnmlP/Jz3sqr4jXulBgHc4qsLXnXLxFuOgY05SAw678mmTod92eSnkqvpnZR8idLDI tZL7a8IhmCrJki4GVaP6LI/14fHCGfLkxpIU04pGublwc5868KssxjHjdlXS+tshAaH0 LJIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=h3IvtyV+tDBtFWNwf1GwwoOFE6oJ9gCF69TG37Rz5oY=; b=ENKfAFn4nIgOK//wREMdR9xE4iW6eQdepWMnyOEzG1BWb4yuTSGs/CfOISDA5tZgmC ZiCbmbxreqyfuAlWW2M2gXwoc02pExpjH7TCcae3ajQ+pDaqvOeOBxhw/IBEV0pwzymr LqA8zDjxLGHj32HoMQ4LfA55baiz1UOz2xeL8y5Fnf65zfupBSIeD5x4otbBOBqZpij2 l7ur/9Ti+sQQwpEfe4ycRGFDenHB8/liXPn+JFc6nFsBpiZGNAdprC8xk7dNkuEKqAYN SXfvgQRmFiFynT1yOVznfuGbFChEGfRCIUyeGcG8lozGw0DnODS8d1+/lJhFksXv5HwP 6q0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=aJkK3yqt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w186si5833701pgd.460.2019.02.18.11.29.21; Mon, 18 Feb 2019 11:29:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=aJkK3yqt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727654AbfBRSwe (ORCPT + 99 others); Mon, 18 Feb 2019 13:52:34 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:47032 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726258AbfBRSwe (ORCPT ); Mon, 18 Feb 2019 13:52:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=h3IvtyV+tDBtFWNwf1GwwoOFE6oJ9gCF69TG37Rz5oY=; b=aJkK3yqtNBRV u+j/DjnVR+sttHqApWfkWhkG3fQph6bgoqz3XdOWM3T5Yqor83yd6GrM/H7b80x3y+vYbSsnQqmD4 ZheerPraYxBZJG4nJ4CxQ+tqgskkNyNaKqgxq5y+gF9PwJ+A34rnd7yonKQ9VEZRo1zPG28cgNn2X r2/ho=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gvo1d-0001i6-Iv; Mon, 18 Feb 2019 18:52:21 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 0C4301128008; Mon, 18 Feb 2019 18:52:21 +0000 (GMT) From: Mark Brown To: Daniel Baluta Cc: Vicente Bergas , Mark Brown , "kuninori.morimoto.gx@renesas.com" , "broonie@kernel.org" , "vicencb@gmail.com" , "alsa-devel@alsa-project.org" , "lgirdwood@gmail.com" , "gregkh@linuxfoundation.org" , "S.j. Wang" , "tiwai@suse.com" , "linux-kernel@vger.kernel.org" , dl-linux-imx , alsa-devel@alsa-project.org Subject: Applied "ASoC: simple-card: Fix refcount underflow" to the asoc tree In-Reply-To: <20190216100927.10017-1-daniel.baluta@nxp.com> X-Patchwork-Hint: ignore Message-Id: <20190218185221.0C4301128008@debutante.sirena.org.uk> Date: Mon, 18 Feb 2019 18:52:21 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: simple-card: Fix refcount underflow has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 461d854c0dba3cdf63cce37ffb9423eca0793a47 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Sat, 16 Feb 2019 10:09:42 +0000 Subject: [PATCH] ASoC: simple-card: Fix refcount underflow of_get_child_by_name() takes a reference we'll need to drop later so when we substitute in top we need to take a reference as well as just assigning. Without this patch we hit the following error: [ 1.246852] OF: ERROR: Bad of_node_put() on /sound-wm8524 [ 1.262261] Hardware name: NXP i.MX8MQ EVK (DT) [ 1.266807] Workqueue: events deferred_probe_work_func [ 1.271950] Call trace: [ 1.274406] dump_backtrace+0x0/0x158 [ 1.278074] show_stack+0x14/0x20 [ 1.281396] dump_stack+0xa8/0xcc [ 1.284717] of_node_release+0xb0/0xc8 [ 1.288474] kobject_put+0x74/0xf0 [ 1.291879] of_node_put+0x14/0x28 [ 1.295286] __of_get_next_child+0x44/0x70 [ 1.299387] of_get_next_child+0x3c/0x60 [ 1.303315] simple_for_each_link+0x1dc/0x230 [ 1.307676] simple_probe+0x80/0x540 [ 1.311256] platform_drv_probe+0x50/0xa0 This patch is based on an earlier version posted by Kuninori Morimoto and commit message includes explanations from Mark Brown. https://patchwork.kernel.org/patch/10814255/ Reported-by: Vicente Bergas Signed-off-by: Daniel Baluta Signed-off-by: Mark Brown --- sound/soc/generic/simple-card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 08df261024cf..dc18c4492955 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -445,7 +445,7 @@ static int simple_for_each_link(struct simple_priv *priv, /* Check if it has dai-link */ node = of_get_child_by_name(top, PREFIX "dai-link"); if (!node) { - node = top; + node = of_node_get(top); is_top = 1; } -- 2.20.1