Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2250081imm; Mon, 16 Jul 2018 05:02:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe96wqDBBdnTB85jdwsWZIULWfLI1tfylpTV72BmNCIcuglvSISd44oqE32q8JOJUCaEu7g X-Received: by 2002:a17:902:6946:: with SMTP id k6-v6mr8462931plt.268.1531742578782; Mon, 16 Jul 2018 05:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531742578; cv=none; d=google.com; s=arc-20160816; b=mH15eTKOSmDyax8WQrUnAwkP7rlWryum2IzwlgTfvmEKAMxo/3oEHcAa6T3P5zLthq YanPcQgyNVoxFx8uoUsINdjFyO06+iAm2ucrZCCrsSaJWiNWu9CsLcPzO0IRslVJUeVk j6LSmqPV2lhbqmz/N6SccCzSigruGgRE3F1o9HCyimukQY0ylmKdsxzkcGXuxuJcSvCC eUKbqDAuY9GlgcCLV6MzCmhOpAEc7BCX2qePDUKzgm6F5lZLBoAZc5rD/4xol7Y803qF LoRKv48ENlSR4SXNX/SduN5alFPxxdPvpiJ3spF2TXz/bffJT4qaPH/lTEgkycyOw3Kn x7Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ugeVYcuv3uKU4dkNZvrENO71mE3YJcSdZ7517fE3+6k=; b=Zl8SL6g8qKmfWFJeweEpjHCG1hA/QEErZ5+xvggUfR1Cu2EC2ybA4HphxoSs3Qj0pZ fhZ0eFLh6gQsPLpNs4osQuqiJK7NRl9Mg8LPmAXtLXU04PIJZtBC59vvlvO3v0MMIArN uKoIjwh763rtZtPSexbjBG6xhljFOKzZGIheRxpt4HTYqNzsiNVGW/JngkRgXmbQ/hM3 ZhLGvgpQTyhXzNkuTUTW5AP/VX1ipG7kPl5kYS7QidVLKAfvyzOvYaDjrsyUHUQeIQje Z1rT0dSmNEZsEytdNZxbvUlaGbVgRtyjkzaDAd4yyKt1RiGjLO9wXahHbfiQqNtIQJTi 2Zdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kCBcehDq; 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 y63-v6si29580496pgb.5.2018.07.16.05.02.32; Mon, 16 Jul 2018 05:02:58 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=kCBcehDq; 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 S1729778AbeGPM2w (ORCPT + 99 others); Mon, 16 Jul 2018 08:28:52 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:43372 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728061AbeGPM2w (ORCPT ); Mon, 16 Jul 2018 08:28:52 -0400 Received: by mail-lf0-f66.google.com with SMTP id m12-v6so32009313lfc.10; Mon, 16 Jul 2018 05:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ugeVYcuv3uKU4dkNZvrENO71mE3YJcSdZ7517fE3+6k=; b=kCBcehDqxCcIuN3ZyozctU3U1u9aktzKb96ORSeXGs56K/0nev4UlQDrc2reAxUDtJ btnbbQSV28+utzTu6+M26+m91eUauT4h025Qorugxo02rOTizQjONZjIYKD8TaQVQVQ7 DT0FJw8HeIdJEp+BTNMAVZWsTVGIKaYgYQHUagCwaC8aIztghMRs3ogUYqAvT2Jm9eLB DEVrg598VlF8SEKk4TUfrKGVoWBrx/E3JZmXUqIfZviC5e+4iz16tXgFCzfjP4nwTn5W x+ccqqitW9KQJIAlbZJ1XfWtAJAImIx97+kixEpYnanJL8/3ID5cysfan24V6Di34k2h J8YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=ugeVYcuv3uKU4dkNZvrENO71mE3YJcSdZ7517fE3+6k=; b=fOO62O9sO4F36a6xXpZ5Hn3PRuQbO1yu47D98IUgneedWG0JdpeqnuLPs5ITj5tWhM +7owop6larAQ7afL/TCuhXAQHapmpt+RHWXWzA/m0N2WiKaEzoCTGOs67tfK7Kz2ijfF IMlt/axQ6KEgzTS6Qtvy+WZSeYg6ulOyD1sv3qAwGq5DTFVogmGYDqxRTRcwrKD1PiuA lSke0TUi2zZle4xE69ZJl4xLSu7+c0wvOqMyIirlymVKL1S04w19J+Wbya4Ydl6A7ap0 NerULGO8hIHYAyzw+PwydBxWQ8Xl0dVtsfQ7v/WyVskrLDaIyy9KZby8GthVnNhDml21 my0Q== X-Gm-Message-State: AOUpUlEySRuTzQNAnUrPFpRwWZ426BDqwgysUKLHDUyK1j0pQnhFGqiM PAx3QOsdsz0OnfvB8ZeDPy4= X-Received: by 2002:a19:4344:: with SMTP id m4-v6mr12238968lfj.111.1531742503456; Mon, 16 Jul 2018 05:01:43 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id 36-v6sm717820lja.65.2018.07.16.05.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 05:01:42 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1ff2C6-0007e0-LI; Mon, 16 Jul 2018 14:01:34 +0200 Date: Mon, 16 Jul 2018 14:01:34 +0200 From: Johan Hovold To: Niklas Cassel Cc: broonie@kernel.org, Liam Girdwood , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] regulator: qcom_spmi: Fix warning Bad of_node_put() Message-ID: <20180716120134.GL10204@localhost> References: <20180716113525.9335-1-niklas.cassel@linaro.org> <20180716113525.9335-2-niklas.cassel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180716113525.9335-2-niklas.cassel@linaro.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Niklas, On Mon, Jul 16, 2018 at 01:35:22PM +0200, Niklas Cassel wrote: > For of_find_node_by_name(), you typically pass what the previous call > returned. Therefore, of_find_node_by_name() increases the refcount of > the returned node, and decreases the refcount of the node passed as the > first argument. > > However, in this case we don't pass what the previous call returned, > so we have to increase the refcount of the first argument to compensate. I don't think this is the right fix. of_find_node_by_name() should generally not be used by drivers in the first place as it searches the entire tree and can end up matching an entirely unrelated node. I haven't looked at the device-tree binding in question, but you probably want to use something like of_get_child_by_name() instead. Johan