powerpc/pseries/iommu: Add of_node_put() before break

Fix following coccicheck warning:

./arch/powerpc/platforms/pseries/iommu.c:924:1-28: WARNING: Function
for_each_node_with_property should have of_node_put() before break

Early exits from for_each_node_with_property should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Reviewed-by: Leonardo Bras <leobras.c@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211014075624.16344-1-wanjiabing@vivo.com
This commit is contained in:
Wan Jiabing 2021-10-14 03:56:04 -04:00 committed by Michael Ellerman
parent 4f703e7faa
commit 915b368f69

View File

@ -929,8 +929,10 @@ static void find_existing_ddw_windows_named(const char *name)
}
window = ddw_list_new_entry(pdn, dma64);
if (!window)
if (!window) {
of_node_put(pdn);
break;
}
spin_lock(&dma_win_list_lock);
list_add(&window->list, &dma_win_list);