Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp2440400ima; Sat, 2 Feb 2019 23:03:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IYwbOzxLQcw/dZUFg5VXTVKQ1nsG+yFNI3C8KG84zjcNFmP3oHwfHsTtqH67074wQYQm4Kp X-Received: by 2002:a63:4665:: with SMTP id v37mr8844386pgk.425.1549177390101; Sat, 02 Feb 2019 23:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549177390; cv=none; d=google.com; s=arc-20160816; b=D+a9BHkoHT/6AL+E7R9FB8y3bUTCjtS1lwatbUQ3FGjgNmtxdKUN1OUQcVvaUfhZrn NF2ujoZc3oAZMVqxsgoBqf6xiHMQadTtJeCb50uPAJgswEfDx+W3wLOnmTZUnk52nZlC F9k7n12kTxFgRfNombDMnqIN3Frg7MnJjS8DjFVW925/7MJxcBr5MEN9G6hf1IUKbIFR WiowcYdCl9EXxGn44pR1+EV07JeXR0nopOpUW+zWglGI6nXwocedgHHLM/RtXusl3LAa q5FLXaIsN0I4Uk60F/3D355ziMeqEvI2ybqjTW88ct/h+GFf7DNAHe+AXbyKwhvXe3GO RGWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date; bh=UlM7IcDd/oT0yO0suCytuAKIoIYpr8ToBMwedvXOeiQ=; b=F0+G05mMTtIenaM4vzXHl7V406E6RwHBKn5h2pY9lg3gbW/QxxmYgjvQl0gbYHdQp+ I9sNP9khTq6FBqzDEsAZVcpwFizCBk2/ff18/E3twhwwS/lwsHcxE0xsYnVCRTdf+qXz gMSUf1GU1iJHa+hrCc+selBAYsRtYlezdek2Y1cB8Y/HCR5RMHoAUTHDAkI79WSUpEEc 1liB6BXcxriXlls04siLYHzryOlXyfZYX4A354lI05Mi4j3xdrTxcljtla7P8B6RATFF yGMQgT+PsUzQNhFTA8B2KbWY0YfMPc4AnZ0Npc0maCdL9o2UCZqqFoCXSZUzTbbMjaMS cj8A== 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 o1si4197354pld.79.2019.02.02.23.02.53; Sat, 02 Feb 2019 23:03:10 -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; 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 S1726997AbfBCHCt (ORCPT + 99 others); Sun, 3 Feb 2019 02:02:49 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:25424 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfBCHCt (ORCPT ); Sun, 3 Feb 2019 02:02:49 -0500 X-IronPort-AV: E=Sophos;i="5.56,555,1539640800"; d="scan'208";a="367739064" Received: from abo-58-107-68.mrs.modulonet.fr (HELO hadrien) ([85.68.107.58]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2019 08:02:47 +0100 Date: Sun, 3 Feb 2019 08:02:46 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Kishon Vijay Abraham I cc: Yoshihiro Shimoda , linux-kernel@vger.kernel.org Subject: question about drivers/phy/renesas/phy-rcar-gen2.c Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I was wondering whether phy-rcar-gen2.c would use dynamically allocated device nodes? If so, it looks like the following code could cause a use-after-free, due to not incrementing th reference count: for_each_child_of_node(dev->of_node, np) { struct rcar_gen2_channel *channel = drv->channels + i; u32 channel_num; int error, n; channel->of_node = np; ... } On the other hand, if the reference cound it incrememnted, preventing memory leaks in the case where the probe function fails would entail some complex rewriting of the code, so I thought it would be better to ask first. thanks, julia