aboutsummaryrefslogtreecommitdiff
path: root/drivers/iommu/amd_iommu_init.c
diff options
context:
space:
mode:
authorWen Yang <[email protected]>2019-04-17 10:41:19 +0800
committerJoerg Roedel <[email protected]>2019-04-26 15:24:19 +0200
commit1eb8e4e2b35b4d83cc40cbf379493490741eb5b8 (patch)
tree6ff7d752c9351fa5379f47340998b716a9482210 /drivers/iommu/amd_iommu_init.c
parent085b7755808aa11f78ab9377257e1dad2e6fa4bb (diff)
iommu/mediatek: Fix leaked of_node references
The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. 581 static int mtk_iommu_probe(struct platform_device *pdev) 582 { ... 626 for (i = 0; i < larb_nr; i++) { 627 struct device_node *larbnode; ... 631 larbnode = of_parse_phandle(...); 632 if (!larbnode) 633 return -EINVAL; 634 635 if (!of_device_is_available(larbnode)) 636 continue; ---> leaked here 637 ... 643 if (!plarbdev) 644 return -EPROBE_DEFER; ---> leaked here ... 647 component_match_add_release(dev, &match, release_of, 648 compare_of, larbnode); ---> release_of will call of_node_put 649 } ... 650 Detected by coccinelle with the following warnings: ./drivers/iommu/mtk_iommu.c:644:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 631, but without a corresponding object release within this function. Signed-off-by: Wen Yang <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
Diffstat (limited to 'drivers/iommu/amd_iommu_init.c')
0 files changed, 0 insertions, 0 deletions