summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorkernel test robot <lkp@intel.com>2021-01-21 21:12:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-26 17:23:50 +0300
commita55a9a4c5c6253f6e4dea268af728664ac997790 (patch)
treedcd37c1eedddfc5b99dd263d0868fcf404f8c4e8 /drivers/usb/gadget
parentd8c6edfa3f4ee0d45d7ce5ef18d1245b78774b9d (diff)
downloadlinux-a55a9a4c5c6253f6e4dea268af728664ac997790.tar.xz
usb: gadget: aspeed: add missing of_node_put
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 <sylphrenadin@gmail.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: kernel test robot <lkp@intel.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2101211907060.14700@hadrien Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/udc/aspeed-vhub/hub.c4
1 files changed, 3 insertions, 1 deletions
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;