Received: by 10.223.164.202 with SMTP id h10csp248846wrb; Mon, 13 Nov 2017 05:57:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMYCsPiCASHJ04zjU4rolubcdlD7oogRN/VN2hSs5APbMFL/ponfFmQ6wTRPZFKzlQbT9kdj X-Received: by 10.98.204.198 with SMTP id j67mr3626360pfk.41.1510581478281; Mon, 13 Nov 2017 05:57:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510581478; cv=none; d=google.com; s=arc-20160816; b=CAdGDHkMExP0JyoQBWV6I67jT3z0IkPhyUXqt+pV1UuL5GbY0wu1MElKc3KKRHs4zz 3cEaV6a2NKjF/LLjQvAxhdTwRvEp0DySu6zRVdntTQElYWXG2+YC1rHNQzlZQeizYJl9 cVtIw2Ic96YQSkptNaFhU3BhtAkjVnKbMmp97hCvSTIIYNqGnOg69iSYSHNTuOKf9A4q HJwXANci0fsHNAF8hlbAkl8OlShfYWZwW6iD1IpMcZOAUj8QW+tAMQ6x9y532itmnfVP SFiHSh+aUL0oVvB2tFpdvx5byIoNDcluX2NWaQegd2bv347jhvhsijLmi6T7pXFHLIXq d9tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Iuc+3lr3Ppzv/wtb2OyP1ysYh+MqfRVHrov0IhBJktw=; b=BZo62+O+xHf6nf/HSEL5UmFMZ1/J7IvtdGoHPCBvMakidNKhcErvh8VucapWvxEYDc wE39V9NB25Zq/rgPDLrusIq4H+xrUIoEIRTJxaGpZwAgxflFFBBshO9NivjWDY+sPS57 fXxX7wiRDOkoa66ABcD2n7qNBcI9stNtP3s/mS2GywTdSifYyaMo2DxTNeM+ZSQxS1iu 2wUCPbFL4jgD6w7KXPYy84r1kAHxrPlrRLhqM2aao1eK2+qjZPMynsjBX5E+xKEnbtjT CQSx4v0RvFelDtc8GJaCdYiNwLFlEbT4EngkDwvX4w+KgJQlC9sPRskj97iNp9qYc6Jr d2ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UtJD1whB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si13969129pgc.703.2017.11.13.05.57.45; Mon, 13 Nov 2017 05:57:58 -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=pass header.i=@linaro.org header.s=google header.b=UtJD1whB; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839AbdKMN5P (ORCPT + 95 others); Mon, 13 Nov 2017 08:57:15 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34139 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbdKMN5N (ORCPT ); Mon, 13 Nov 2017 08:57:13 -0500 Received: by mail-wm0-f66.google.com with SMTP id n74so14184629wmi.1 for ; Mon, 13 Nov 2017 05:57:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Iuc+3lr3Ppzv/wtb2OyP1ysYh+MqfRVHrov0IhBJktw=; b=UtJD1whBzA//6IVNgwKOq1XEDla2K+Dh/feeB3RrMAqijcH5boY/dUH2DQvb5WZJ7X gOUjgUdW8zMFDMqa0b5UC09q1Tg+A3PDSrCrb+5RxgaPHy1oSzntmh+ycQUvEXZEEGUa dg+oOQTycOLQnouYF/QTC3V3Ii8Azdccl0kiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Iuc+3lr3Ppzv/wtb2OyP1ysYh+MqfRVHrov0IhBJktw=; b=Gdk6sAeAwwGwwnfxIcp9gbYXAmWPuM8htNc4ApqaiwtH4gZ1zUnE217DW9nGQ2zqnl x60Htiha16yiGvpvuZK5ENccZeUtd2VbUtRSpFiFNBQGPf3lNxeUq/ELJs1tDkscRqct PwDmj7wd8wnB2yLnOB1ITcCBCgF5dmcqREweIwS4rMxjcocbuHmsqhHPB0xx+8qYiNhX xUBsfszSUki4Ym8H1Qr0GfB+mUDauUnCNPUOyP0hwyzCHBB3QQW4opZV00VC/JzI+LDk /h3Xzc5W6K/6lo82vkppUS3STOwd/phEtY8qy/cnUzVfjCYyVKdFR/wWcbHaauCir/pm eV9w== X-Gm-Message-State: AJaThX4XWzDFka/J+SWMr2Dsfz4dsIhiiGg9tnKYljG3yWfRciPL7wtR fWOWB0Rl7GT45X1Nv6JW5xEXZg== X-Received: by 10.80.140.153 with SMTP id q25mr13303607edq.147.1510581432055; Mon, 13 Nov 2017 05:57:12 -0800 (PST) Received: from [192.168.2.193] (cpc87211-aztw31-2-0-cust196.18-1.cable.virginm.net. [82.46.60.197]) by smtp.gmail.com with ESMTPSA id a1sm13340905edb.37.2017.11.13.05.57.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2017 05:57:11 -0800 (PST) Subject: Re: [PATCH 2/3] backlight: max8925_bl: fix device-tree node lookup To: Johan Hovold , Lee Jones Cc: Jingoo Han , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Qing Xu , Haojian Zhuang References: <20171113102049.9342-1-johan@kernel.org> <20171113102049.9342-2-johan@kernel.org> From: Daniel Thompson Message-ID: <46845070-588c-145f-67aa-42e1011c2d8e@linaro.org> Date: Mon, 13 Nov 2017 13:57:05 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171113102049.9342-2-johan@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/11/17 10:20, Johan Hovold wrote: > 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 mfd node was also prematurely freed, > while the child backlight node was leaked. > > Fixes: 47ec340cb8e2 ("mfd: max8925: Support dt for backlight") > Cc: stable # 3.9 > Cc: Qing Xu > Cc: Haojian Zhuang > Signed-off-by: Johan Hovold Acked-by: Daniel Thompson > --- > drivers/video/backlight/max8925_bl.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c > index 7b738d60ecc2..f3aa6088f1d9 100644 > --- a/drivers/video/backlight/max8925_bl.c > +++ b/drivers/video/backlight/max8925_bl.c > @@ -116,7 +116,7 @@ static void max8925_backlight_dt_init(struct platform_device *pdev) > if (!pdata) > return; > > - np = of_find_node_by_name(nproot, "backlight"); > + np = of_get_child_by_name(nproot, "backlight"); > if (!np) { > dev_err(&pdev->dev, "failed to find backlight node\n"); > return; > @@ -125,6 +125,8 @@ static void max8925_backlight_dt_init(struct platform_device *pdev) > if (!of_property_read_u32(np, "maxim,max8925-dual-string", &val)) > pdata->dual_string = val; > > + of_node_put(np); > + > pdev->dev.platform_data = pdata; > } > > From 1583945912735744824@xxx Mon Nov 13 10:22:15 +0000 2017 X-GM-THRID: 1583945912735744824 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread