From patchwork Thu Jan 21 18:12:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 12037327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78837C433E9 for ; Thu, 21 Jan 2021 18:14:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 331A723A5B for ; Thu, 21 Jan 2021 18:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728851AbhAUSOe (ORCPT ); Thu, 21 Jan 2021 13:14:34 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:60300 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389592AbhAUSNj (ORCPT ); Thu, 21 Jan 2021 13:13:39 -0500 X-IronPort-AV: E=Sophos;i="5.79,364,1602540000"; d="scan'208";a="370735789" Received: from clt-128-93-176-60.vpn.inria.fr ([128.93.176.60]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 19:12:54 +0100 Date: Thu, 21 Jan 2021 19:12:54 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Tao Ren , Benjamin Herrenschmidt cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kbuild-all@lists.01.org, Sumera Priyadarsini , linux-kernel@vger.kernel.org Subject: [PATCH] usb: gadget: aspeed: add missing of_node_put Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: kernel test robot 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 --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 45dfb8a5659ad286c28fa59008271dbc4e5e3f2d commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script :::::: branch date: 17 hours ago :::::: commit date: 3 months ago Please take the patch only if it's a positive warning. Thanks! hub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- 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(st 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;