Skip to content

Commit

Permalink
usb: gadget: aspeed: add missing of_node_put
Browse files Browse the repository at this point in the history
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: 82c2d81 ("coccinelle: iterators: Add for_each_child.cocci script")
CC: Sumera Priyadarsini <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2101211907060.14700@hadrien
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
intel-lab-lkp authored and gregkh committed Jan 26, 2021
1 parent d8c6edf commit a55a9a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/gadget/udc/aspeed-vhub/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a55a9a4

Please sign in to comment.