Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5661306imm; Mon, 27 Aug 2018 01:50:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaAgNTeNjWsqtk1BgQtAReV8QQ22R+7LRkQqT3VPuPPK0A6GgasUEmk4p4X+bylPnZSG7dD X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr11420612pgu.260.1535359836718; Mon, 27 Aug 2018 01:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535359836; cv=none; d=google.com; s=arc-20160816; b=Zx6LDTAmTye1v0aiSm5IGNFic4y23vroOCU+8gndPTqt7WKgE4uGZ+nm6uHDWP5Qpx BPk774yK5rAAZsmmNtXTVrdGhKQqtwgCBBwRjd49aJmJjZ8xWDjpcqFgyX9y8cgWg+Kn wl7hRuNdZ483xjZEdGlprF/IgPWeRLSbjBf/mZLtRORNoag1QlQbsoMFJ9b8mY9JmCbI dk2lCw4wzY1RfmtyAKFb7xH2eon2nZjb87iIrCitBgBoAhAYaJv4kosPIARrl5dePP4m fj3VUX9iBsemfmwpLOmekbfMsoQ+gGOw6b1HX85/nwJVtRaJryJDvZkqsO1mZtye7dr0 JS0w== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=9h6wWQHpTyeA6GTHoJxZFqs3gZW1feS4M/ZYIT8AqHw=; b=PuXHUfldC+QA5B8vqAEaFP4DezkeDLK2Hhvkvhu6FNTdeUYjc1Ra/EaBhAfweymRTw ZW0hQ+I64gWDXaQBi7VzZpu/kXbf9nG/RHt3A3CpFohwBMxPvxFu15bGhhE56stELHl/ 8xZ7q6Rm7NG6Q0t+bulrtYpOob8FdYYbW+dSk6Ww2zeoCP4pLcEuSyYqUyH5KfDdB+J7 0bYLtBgLM8jZ6TaVi64depYnoybZvd6VRyQ5cYu1T55Ijl/crBT3+RR9j+SSc81i3TH7 4voweEoacLv6E+RPjBF22BeX1Dp7EyW0zxFPg7i+JASfCtLy8NZWkTLeVlRAzZsymjUB FPQw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si8398520plr.193.2018.08.27.01.50.20; Mon, 27 Aug 2018 01:50:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbeH0Me3 (ORCPT + 99 others); Mon, 27 Aug 2018 08:34:29 -0400 Received: from mail.bootlin.com ([62.4.15.54]:32990 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbeH0Me3 (ORCPT ); Mon, 27 Aug 2018 08:34:29 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 8439C20787; Mon, 27 Aug 2018 10:48:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-53-19.w90-88.abo.wanadoo.fr [90.88.170.19]) by mail.bootlin.com (Postfix) with ESMTPSA id 2A22C203EC; Mon, 27 Aug 2018 10:48:45 +0200 (CEST) Date: Mon, 27 Aug 2018 10:48:42 +0200 From: Boris Brezillon To: Johan Hovold Cc: Rob Herring , Greg Kroah-Hartman , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Nicolas Ferre , Josh Wu Subject: Re: [PATCH v2 5/9] mtd: nand: atmel: fix OF child-node lookup Message-ID: <20180827104842.26bce912@bbrezillon> In-Reply-To: <20180827084414.GZ14967@localhost> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-6-johan@kernel.org> <20180827102820.3abf7291@bbrezillon> <20180827084414.GZ14967@localhost> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Aug 2018 10:44:14 +0200 Johan Hovold wrote: > On Mon, Aug 27, 2018 at 10:28:20AM +0200, Boris Brezillon wrote: > > Hi Johan > > > > On Mon, 27 Aug 2018 10:21:49 +0200 > > Johan Hovold wrote: > > > > > Use the new of_get_compatible_child() helper to lookup the nfc child > > > node instead of using of_find_compatible_node(), which searches the > > > entire tree from a given start node and thus can return an unrelated > > > (i.e. non-child) node. > > > > > > This also addresses a potential use-after-free (e.g. after probe > > > deferral) as the tree-wide helper drops a reference to its first > > > argument (i.e. the node of the device being probed). > > > > > > While at it, also fix a related nfc-node reference leak. > > > > > > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > > > Cc: stable # 4.11 > > > Cc: Nicolas Ferre > > > Cc: Josh Wu > > > Cc: Boris Brezillon > > > Signed-off-by: Johan Hovold > > > > Acked-by: Boris Brezillon > > Thanks for the ack. > > > I'll let Miquel queue this patch to the nand/next branch, unless you > > want it to be merged in 4.19, in which case I'll queue it to the > > mtd/fixes branch. > > Note that there's a dependency on the first patch of the series which > adds the new helper. I was not Cc-ed on this patch :P. > Rob can pick up the entire series if the various > maintainers agree, otherwise I'll try to get at the least the helper > into -rc2. If everything goes in 4.19-rc2 through Rob's tree that's fine, but if it's queued for 4.20 we might need an immutable tag just in case we queue conflicting changes to the NAND tree. Thanks, Boris