From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946058AbcA1RPd (ORCPT ); Thu, 28 Jan 2016 12:15:33 -0500 Received: from foss.arm.com ([217.140.101.70]:33810 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966760AbcA1RP2 (ORCPT ); Thu, 28 Jan 2016 12:15:28 -0500 Subject: Re: [RFC PATCH 3/6] of: iommu: Increment DT node refcount in of_iommu_set_ops() To: Anup Patel , Catalin Marinas , Joerg Roedel , Will Deacon , Robin Murphy , Sricharan R , Linux IOMMU , Linux ARM Kernel References: <1453872079-27140-1-git-send-email-anup.patel@broadcom.com> <1453872079-27140-4-git-send-email-anup.patel@broadcom.com> Cc: Mark Rutland , Device Tree , Scott Branden , Pawel Moll , Ian Campbell , Ray Jui , Linux Kernel , Vikram Prakash , Rob Herring , BCM Kernel Feedback , Kumar Gala From: Robin Murphy Message-ID: <56AA4CAB.6000708@arm.com> Date: Thu, 28 Jan 2016 17:15:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1453872079-27140-4-git-send-email-anup.patel@broadcom.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/01/16 05:21, Anup Patel wrote: > We are saving pointer to iommu DT node in of_iommu_set_ops() > hence we should increment DT node ref count. Oh man, shame on whoever wrote that code! :P Reviewed-by: Robin Murphy > Signed-off-by: Anup Patel > Reviewed-by: Ray Jui > Reviewed-by: Scott Branden > --- > drivers/iommu/of_iommu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c > index 60ba238..5fea665 100644 > --- a/drivers/iommu/of_iommu.c > +++ b/drivers/iommu/of_iommu.c > @@ -110,6 +110,7 @@ void of_iommu_set_ops(struct device_node *np, struct iommu_ops *ops) > if (WARN_ON(!iommu)) > return; > > + of_node_get(np); > INIT_LIST_HEAD(&iommu->list); > iommu->np = np; > iommu->ops = ops; >