Skip to contentSkip to conversation

iommu/mtk_iommu_v1: add missing put_device()

PATCH New [email protected] 1 participant 1 message Jul 18, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 iommu/mtk_iommu_v1: add missing put_device()

The of_find_device_by_node() takes a reference to the underlying device structure, we should release that reference.

./drivers/iommu/mtk_iommu_v1.c:669:3-9: ERROR: missing put_device; call of_find_device_by_node on line 662, but without a corresponding object release within this function.

---
 drivers/iommu/mtk_iommu_v1.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iommu/mtk_iommu_v1.c +1 -0
index 8a0a5e5d049f..1833d0ce7afe 100644
@@ -666,6 +666,7 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev)
         }
         if (!plarbdev->dev.driver) {
             of_node_put(larbnode);
+            put_device(&plarbdev->dev);
             return -EPROBE_DEFER;
         }
         data->larb_imu[i].dev = &plarbdev->dev;