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: 12037325 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.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 483ADC433E0 for ; Thu, 21 Jan 2021 18:14:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0D1423A56 for ; Thu, 21 Jan 2021 18:14:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0D1423A56 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=u3izGG35ps5qaKPLBUnwBUUi8u/6VVQNuYE+FZMNWYE=; b=hUyhv+tJl5F374kDQrx5mIYB+s 3105wxkyF6nn6v97knG5rezRjHvhsr8Lu5EHh8xEGXMG+BHMFYE1lC6B/G8i7VFC6DHdqvtQ6AMFy h1hHelPnfvp46nBDjum3cJvcNejUyWOPFn7B428LWHINsBxH7uol9UoQQdJW6kUuS06x4kjpUDkdJ QtkGtKKb0RHw2Em2G65dcl+4m6XhOc3bDYgUk3XC0ULTjttdFBKmdoJhzTUkB8SBGA6iRLsMt/TTF wpglSejdO546RIanhyKMkXITB+lxeWoIY48Orj22aqxjorfE/1Xvd2ngupH1BfqOSrLhm9fGXu3Nj mlbRr3nQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2eS8-0000YF-JP; Thu, 21 Jan 2021 18:13:04 +0000 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2eS5-0000Wu-VO for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 18:13:03 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_131302_213769_3E8C106B X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sumera Priyadarsini , linux-usb@vger.kernel.org, kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;