From: kernel test robot Date: Thu, 21 Jan 2021 18:12:54 +0000 (+0100) Subject: usb: gadget: aspeed: add missing of_node_put X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~363^2~1851 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=4025244544b802d15eee76840702a3088b89624b;p=linux.git usb: gadget: aspeed: add missing of_node_put commit a55a9a4c5c6253f6e4dea268af728664ac997790 upstream. Breaking out of for_each_child_of_node requires a put on the child value. Generated by: scripts/coccinelle/iterators/for_each_child.cocci Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script") CC: Sumera Priyadarsini Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Cc: stable Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2101211907060.14700@hadrien Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c index 6497185ec4e7..bfd8e77788e2 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c @@ -999,8 +999,10 @@ static int ast_vhub_of_parse_str_desc(struct ast_vhub *vhub, str_array[offset].s = NULL; ret = ast_vhub_str_alloc_add(vhub, &lang_str); - if (ret) + if (ret) { + of_node_put(child); break; + } } return ret;