From patchwork Sat Aug 28 11:04: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: 12463389 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 310B6C432BE for ; Sat, 28 Aug 2021 11:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F83F60EBA for ; Sat, 28 Aug 2021 11:04:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbhH1LFr (ORCPT ); Sat, 28 Aug 2021 07:05:47 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:21460 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233784AbhH1LFr (ORCPT ); Sat, 28 Aug 2021 07:05:47 -0400 IronPort-HdrOrdr: A9a23:wnV+jq0A1F6awbqqHksX7AqjBLkkLtp133Aq2lEZdPU1SL37qynApp8mPHPP4gr5O0tQ+uxoWpPgfZq0z/cc3WB7B9mftWfd1FdAYLsD0aLShwylISH4++JHvJ0MT4F1ArTLYmRHsQ== X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="391310565" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Aug 2021 13:04:54 +0200 Date: Sat, 28 Aug 2021 13:04:54 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Rohit Athavale cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org, Rohit Athavale , Michal Simek , Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] v4l: xilinx-vpss-csc: fix for_each_child.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: kernel test robot for_each_child_of_node should have of_node_put() before return. Generated by: scripts/coccinelle/iterators/for_each_child.cocci CC: Rohit Athavale Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- tree: https://github.com/Xilinx/linux-xlnx master head: 45cd0074cdf1ddd710b28848e6a860b442babfcc commit: 7d47a653da2e81cb73f43e507664d36305819ea1 [10741/12418] v4l: xilinx-vpss-csc: driver support for xilinx vpss csc :::::: branch date: 5 days ago :::::: commit date: 5 months ago Please take the patch only if it's a positive warning. Thanks! xilinx-vpss-csc.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/media/platform/xilinx/xilinx-vpss-csc.c +++ b/drivers/media/platform/xilinx/xilinx-vpss-csc.c @@ -749,17 +749,20 @@ static int xcsc_parse_of(struct xcsc_dev vip_format = xvip_of_get_format(port); if (IS_ERR(vip_format)) { dev_err(dev, "Invalid media pad format in DT"); + of_node_put(port); return PTR_ERR(vip_format); } rval = of_property_read_u32(port, "reg", &port_id); if (rval < 0) { dev_err(dev, "No reg in DT to specify pad"); + of_node_put(port); return rval; } if (port_id != 0 && port_id != 1) { dev_err(dev, "Invalid reg in DT"); + of_node_put(port); return -EINVAL; } xcsc->vip_formats[port_id] = vip_format;