From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756083AbdKNTsV (ORCPT ); Tue, 14 Nov 2017 14:48:21 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55410 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754635AbdKNTsP (ORCPT ); Tue, 14 Nov 2017 14:48:15 -0500 X-Google-Smtp-Source: AGs4zMbM6stCa1SkNIJP6JcqIdNFQNNw5jMRjL8jF5BQH6Bl615NzkFwEFwg/fAxwmPuFb5KB0IEtA== Subject: Re: [PATCH 1/3] backlight: as3711_bl: fix device-tree node lookup To: Johan Hovold Cc: Lee Jones , Jingoo Han , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Guennadi Liakhovetski References: <20171113102049.9342-1-johan@kernel.org> <94c3debe-17f6-9151-eefe-129f2bd1cfd4@linaro.org> <20171114180514.GA11226@localhost> From: Daniel Thompson Message-ID: Date: Tue, 14 Nov 2017 19:48:09 +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: <20171114180514.GA11226@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/11/17 18:05, Johan Hovold wrote: > On Mon, Nov 13, 2017 at 02:16:09PM +0000, Daniel Thompson wrote: >> 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. >>> >>> Note that the nodes returned from the two calls to of_parse_phandle() >>> are also leaking, but fixing that is a bit more involved as pointers to >>> node fields are being stored for later use. >> >> Is using a devm_kstrdup() to remember the full_name sufficient so get >> each of the FIXMEs cleaned up as well? > > Yeah, that may be sufficient, but looking closer at this now, it seems > the name pointers (su1_fb and su2_fb) are only used as booleans, and the > fb_name pointer in struct as3711_bl_data is never used at all. > > So cleaning that up somehow (e.g. and maybe even dropping non-dt > probing) would also work. > > But since this is a separate, and less critical issue, I think it needs > to be done as a follow up to this one. To be honest it was adding the separate and less critical FIXMEs into the patches that attracted my attention in the first place. ;-) Daniel.