]> git.karo-electronics.de Git - linux-beck.git/commitdiff
of: iommu: Increment DT node refcount in of_iommu_set_ops()
authorAnup Patel <anup.patel@broadcom.com>
Wed, 27 Jan 2016 05:21:16 +0000 (10:51 +0530)
committerWill Deacon <will.deacon@arm.com>
Thu, 18 Feb 2016 15:02:43 +0000 (15:02 +0000)
We are saving pointer to iommu DT node in of_iommu_set_ops()
hence we should increment DT node ref count.

Reviewed-by: Ray Jui <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/of_iommu.c

index 60ba238090d92f3eed93de994d5fd7271a68b8ce..5fea665af99d1168cd8541746f45fa6e17e5a14c 100644 (file)
@@ -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;