From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robin Murphy Subject: Re: [RFC PATCH 3/6] of: iommu: Increment DT node refcount in of_iommu_set_ops() Date: Thu, 28 Jan 2016 17:15:23 +0000 Message-ID: <56AA4CAB.6000708@arm.com> References: <1453872079-27140-1-git-send-email-anup.patel@broadcom.com> <1453872079-27140-4-git-send-email-anup.patel@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1453872079-27140-4-git-send-email-anup.patel@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org To: Anup Patel , Catalin Marinas , Joerg Roedel , Will Deacon , Robin Murphy , Sricharan R , Linux IOMMU , Linux ARM Kernel Cc: Mark Rutland , Device Tree , Scott Branden , Pawel Moll , Ian Campbell , Ray Jui , Linux Kernel , Vikram Prakash , Rob Herring , BCM Kernel Feedback , Kumar Gala List-Id: devicetree@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; >