Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdG0Xfi (ORCPT ); Thu, 27 Jul 2017 19:35:38 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37696 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbdG0Xfh (ORCPT ); Thu, 27 Jul 2017 19:35:37 -0400 From: Antonio Borneo X-Google-Original-From: Antonio Borneo To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org Cc: Antonio Borneo , linux-kernel@vger.kernel.org, Wei Xu , John Stultz , linux-arm-kernel@lists.infradead.org, Kuninori Morimoto Subject: [PATCH v2 0/3] ASoC: fix unbalanced of_node_get()/of_node_put() Date: Fri, 28 Jul 2017 01:26:09 +0200 Message-Id: <20170727232612.23543-1-antonio.borneo@st.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170725214952.6491-1-borneo.antonio@gmail.com> References: <20170725214952.6491-1-borneo.antonio@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 37 From: Antonio Borneo On Hikey target board, enabling CONFIG_OF_DYNAMIC triggers several errors at kernel boot, like OF: ERROR: Bad of_node_put() on /soc/i2s@f7118000/ports/port@0 OF: ERROR: Bad of_node_put() on /soc/i2s@f7118000/ports/port@0/endpoint each followed by stack dump. Fixed by: - removing of_node_put() in the body of of_for_each_phandle(){}, since already provided at each iteration. Add it in case the loop is break out; - adding of_node_get() before calling of_graph_get_port_parent(). Tested with kernel v4.13-rc2 with hikey_defconfig taken from https://git.linaro.org/people/john.stultz/android-dev.git branch dev/hikey-mainline-WIP v1 -> v2: - modify subject "s/fix balance of/fix unbalanced/"; - split the patch per each individual issue. It also simplify the backport; - add ref to the commit being fixed; - drop one fix not needed. Antonio Borneo (3): ASoC: fix use of of_node_put() in of_for_each_phandle() loops ASoC: soc-core: fix unbalanced of_node_get()/of_node_put() ASoC: simple-card-utils: fix unbalanced of_node_get()/of_node_put() sound/soc/generic/audio-graph-card.c | 9 ++++----- sound/soc/generic/simple-card-utils.c | 5 +++++ sound/soc/soc-core.c | 5 +++++ 3 files changed, 14 insertions(+), 5 deletions(-) -- 1.9.1