Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2572909rwd; Wed, 14 Jun 2023 04:58:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6YnP+KaQEBl4RB2vx41b2/bkLyoh0BzKV5a7EzVwk1B690gbseYJJTM55N3v5caf4v5jrX X-Received: by 2002:a17:906:db0c:b0:96f:e5af:ac5f with SMTP id xj12-20020a170906db0c00b0096fe5afac5fmr14534527ejb.47.1686743893788; Wed, 14 Jun 2023 04:58:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686743893; cv=pass; d=google.com; s=arc-20160816; b=nhzoGg7rX0594wiNpJsRCwmDtHUabDT4oIZpC7x040ZG2lI4yrU6CMiqUlw0o6QimJ kwdQkaDQH80Dbb5qOSD7ZX9TM7QLf6DopQ3kxFfn+WK1k6U5gaxA1KZB4vRlx9n+Jvs2 zm8m1bVZM7F4C95Q379PDZeeEUUatafs7nIEnEpIh1LlztalRQuv3mb66QE7qNCbHli0 +AoFN6eb0iSsjyBdHityzEXT1gs/WrclKEW2NqxWwFYgLBOiWMleNtH3AJtPKehPEkZz SbZIFm1tH+1hqFbfIvYyRfOvH9NB+ipN3Q89gqyD70Wh7ILpmWNovf1NGzihmmH8d4FE FZsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=oH4ORBdq1gfG1j5hOHyBs9nGhOHX3ka8WOXR6em4C0c=; b=O6BRvi4eB3ACIifhnl6a9iV8b8Vfu3Wq3S1pO6lAhV3TdETbTPl+CzGO9ltyjmkRkO tsWCQb2XwdcWcOfHqGY782dw84CuqUWnSMlIU1XNEkoOckNuQz9V0FN95yYvf++s1/z+ vAlOqtkOOOEJ9Uxe7+QFQbMd/VD3/YSmhCLgk/js6QbR/5sHk/i2RBhFWe1CdM7SSSui hyQ3kPrcTgpJjHZl6HO88skCawvx9TByg+4kObkprE937XMEBrXgK5EXfpSQNqFcBVse X2XSyZZ21MPiN/bUnY1oR2xR/M7Yp4mnxx/dPt1PU1n9CUkL+VNOgpRUwFnBorXyIU9C 6/uw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=bU3sjmZI; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a170906941000b00977d3397543si7979290ejx.220.2023.06.14.04.57.49; Wed, 14 Jun 2023 04:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=bU3sjmZI; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242938AbjFNLaH (ORCPT + 99 others); Wed, 14 Jun 2023 07:30:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244060AbjFNL34 (ORCPT ); Wed, 14 Jun 2023 07:29:56 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2095.outbound.protection.outlook.com [40.107.117.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34F361BE9; Wed, 14 Jun 2023 04:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1BahQwcwPRHCztMrvjlHpzUYxLSjjfKMXGAjpFCduk08o4XqFxIZcKpMSrNGIOVZCjlZbPouLr1GAoRkVbk543xtr0ZcUSObauI7hiQVz8VbUdvmiMYviQ+0mWAPqEaFnoXemuzYmUte1zIbQczjkDQyeHxfnK5CB0Q4qE0OKAOpBirbeWczhUX4NA8HGKWxZvKanhevcv5grLTgmYCJfE188rESxSJFYoLtIv+hlYjPs3Qrsmiy6dpSG3VDc6bOg95CdPcJDzJihbxZuTa1QTgtpz/qyzIU+SPC/voRPBUeOKVMh/+vCJ0Ss6inpUC7zRaNHJ0DcM5EgBktY8HOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oH4ORBdq1gfG1j5hOHyBs9nGhOHX3ka8WOXR6em4C0c=; b=O+9hnkMKxiFrDrzGtgjM9kdvbcXrj5VMvYhDS5Qc/X8bX4UBWNTpJhD4DPg+C25caiP2Vr6AnD/2xj00tuzSpYepIqwFjrG2tb5UPvALd0FN+Yyp9DqQQ+wq4jUzu0VHO8dFitQQMhsGwsqrTl/ycJu1OV0k6LqguC+K/nw/oiSHE+5QIz1XwgDOJ76Slp6XxoNHUiHI61X/7hUbdSbaiLOmsdnOqDXvlRLHMGxqbOm0aQL2H9g5xr4TUnhkDLLD/+euBJZAQA5Af3W1CNxqglluQ3YX+hrSPbh2QYhIlRUw5+/jSMVpHZ/KExAurneCFu2z6Wb7Ejy4dZCNO+sMGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oH4ORBdq1gfG1j5hOHyBs9nGhOHX3ka8WOXR6em4C0c=; b=bU3sjmZIH73xL2ZDJ6s6wYGjpnH3u+4XTfAAvxvTC8pxdjJiGu9gHiB2KUsyNmsSisI3wXz1Hze81kwuVkxpB/8qxuqPTFz2FfQz/e84B4+7nquCxVMFS4GPhcD7Dxp3m4+11meJvSsjW7T7rvJYUcJV83liv/tbiz/uhJIFWPSIAjfEM+ytDPlkKGqCL8skwaVmlDty1MGA0ZBvpEtzZHVXziP0GgrN9sw2++62rqszm13JUeQLQDR+rzOFRokXwS7uLDKMZeU6Ut3CXKN57xz8hRSWKf0BikdxHgiH95XY7R/0yq5XFmwtHJ+fQKS9aAiIQsj+m1aq67p5N4eJxA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3743.apcprd06.prod.outlook.com (2603:1096:4:d0::18) by TYZPR06MB6141.apcprd06.prod.outlook.com (2603:1096:400:343::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.29; Wed, 14 Jun 2023 11:29:51 +0000 Received: from SG2PR06MB3743.apcprd06.prod.outlook.com ([fe80::7dfd:a3ed:33ca:9cc8]) by SG2PR06MB3743.apcprd06.prod.outlook.com ([fe80::7dfd:a3ed:33ca:9cc8%6]) with mapi id 15.20.6455.045; Wed, 14 Jun 2023 11:29:50 +0000 From: Wang Ming To: Peter Korsgaard , Peter Rosin , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Wang Ming Subject: [PATCH v1] drivers/i2c/muxes:Fix resource leaks in device_for_each_child_node() loops Date: Wed, 14 Jun 2023 19:28:50 +0800 Message-Id: <20230614112903.667-1-machel@vivo.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-ClientProxiedBy: TYWPR01CA0028.jpnprd01.prod.outlook.com (2603:1096:400:aa::15) To SG2PR06MB3743.apcprd06.prod.outlook.com (2603:1096:4:d0::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB3743:EE_|TYZPR06MB6141:EE_ X-MS-Office365-Filtering-Correlation-Id: a4d4af41-2059-40c5-65af-08db6ccaaab6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bIbnFfG0sSdd3vBSKl+7giVc/VvA7brKt8cd+iMchObX3/monDxuZcEIn7e+zSp3wa1pzbE+vGfOfyZWy3TD9QkEz1XFlOaUl0Eedgf5RsFkw34MAa4swqblU/YMHqQoFoW7CuI8UlVNn/6EpN3WcMNPLaLIUxQdAHtHAfxvG0og09F452jYFYXM/FwSMe7DlZeev+zqJuxZjc/IedsLzhyBHlDU41WFLlsWXFaFzbTI95HFbqDNc15fA06V5Lbuvk/4CXi5/NmeuoTeUikZRBidzGJpC3aR4rGSMBVQXD6Uo+YVkb0u2qsx75XSmJKEoVqNNjj1//KHEoMkiL10AUinSRoijntpH21ymP/7wbtU8C3mHWk6DDPC6pHtA9n0v/bhxSRqUOXvocGPvRBkXKvsoFuairJE7IllrvOuKThmM5QLw7Z1dmlbXydF0YvQK+bOnlsfj/Z2x2efbMrDuUj4W75H3Z2KfpKQoxbuSHWI1x+rfHdE4XBE/fFHsmpylMbPNHiXOsCY5UyWqCUhpYpK+BOh0d0gNjSlNHilZWOo1u+xtzCVxXjdtN/r7+Cj/9tis66Qzg8VyguXVRQBDyHTie4YsLCoUChWdchSEyu30rz0an0TudGeAunkR9Wx X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3743.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(366004)(451199021)(86362001)(6486002)(107886003)(316002)(8676002)(41300700001)(5660300002)(26005)(83380400001)(52116002)(6512007)(38350700002)(38100700002)(1076003)(6506007)(8936002)(66556008)(36756003)(66946007)(4326008)(478600001)(186003)(2906002)(66476007)(2616005)(110136005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KjiTaO/K4PmUQtg8sPoG9p6G3eDojxL/yNJVQsqSWiSMJDA7D7UK8ECb6tgO?= =?us-ascii?Q?96S0TzO76BlwJqMNWb4cPs0BykI7wtkmnupi5PfRE8KpzKgfJ3zI3YIyGD92?= =?us-ascii?Q?10kbxToADwCBGMbiqJpgq+u/hWoVfNGn0RbSMWb852eSD85SeAW7+3Xck9X7?= =?us-ascii?Q?8zBVH92b5fXxVVOouzd68Qkd6buySTS9VEskdpiLc0gxpK2kA7XrioCLp+Y7?= =?us-ascii?Q?0R4d/ufKxv4k/qLtphujG/rzUtX6ZMQgeizNDTRBGOsCTYQMNypVikMbqRm+?= =?us-ascii?Q?lO8k6ZCcIsbhH8Hm4AEvcmi1rGrxDHXSnRIDh/ZarixlrCVXYo3OK7DyNjW9?= =?us-ascii?Q?o9bqzii68l26nmWc42pz86vbFnJcaHNJGYHgyOHQL2R+0f5HzE0v9LnEZksE?= =?us-ascii?Q?TcotZGvEq1nBolUvvdhb5a38wmWTG54+Xs79TmqZ1A5Wu5ShC+P+R7XqzqP8?= =?us-ascii?Q?v7+Ho1D/rCKAfiMgo9SsXdzEvCmC0cOqL00qwMWSIMXHHaq+OacfKlk+z5FI?= =?us-ascii?Q?NX3Ud9Hh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fgxQEdi8n5H?= =?us-ascii?Q?zo8Ye3Q23lf4sZTICRvSpJjIESlPtoubjUl0wBwgDoI70nBjljrCO1/Zf0Pc?= =?us-ascii?Q?AtqCp0aoYUI5JLTTDmKnqX67PIQctCxootg8qkqE1sQRBJzS3gQcQzhanW4U?= =?us-ascii?Q?j4+jsepM/Q+AKd1dzqxhJL7fXNRp5F4/K4EIpXY5?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4d4af41-2059-40c5-65af-08db6ccaaab6 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3743.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2023 11:29:50.9029 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vfHnV12J7WUPGbV/lLj3fvLEzO3gsoNDrb8BmZQB1/HsLc5Ik2adv3Xld4w05em+Ldn5HuXM5tgOiwQPaKkzrg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB6141 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device_for_each_child_node loop in i2c-mux-gpio should have fwnode_handle_put() before return which could avoid resource leaks.This patch could fix this bug. Signed-off-by: Wang Ming --- drivers/i2c/muxes/i2c-mux-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-g= pio.c index 5d5cbe013..90966de7a 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c @@ -106,6 +106,7 @@ static int i2c_mux_gpio_probe_fw(struct gpiomux *mux, } else if (is_acpi_node(child)) { rc =3D acpi_get_local_address(ACPI_HANDLE_FWNODE(ch= ild), values + i); if (rc) + fwnode_handle_put(child); return dev_err_probe(dev, rc, "Cannot get a= ddress\n"); } -- 2.25.1 ________________________________ =E6=9C=AC=E9=82=AE=E4=BB=B6=E5=8F=8A=E5=85=B6=E9=99=84=E4=BB=B6=E5=86=85=E5= =AE=B9=E5=8F=AF=E8=83=BD=E5=90=AB=E6=9C=89=E6=9C=BA=E5=AF=86=E5=92=8C/=E6= =88=96=E9=9A=90=E7=A7=81=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=BB=85=E4=BE=9B=E6=8C= =87=E5=AE=9A=E4=B8=AA=E4=BA=BA=E6=88=96=E6=9C=BA=E6=9E=84=E4=BD=BF=E7=94=A8= =E3=80=82=E8=8B=A5=E6=82=A8=E9=9D=9E=E5=8F=91=E4=BB=B6=E4=BA=BA=E6=8C=87=E5= =AE=9A=E6=94=B6=E4=BB=B6=E4=BA=BA=E6=88=96=E5=85=B6=E4=BB=A3=E7=90=86=E4=BA= =BA=EF=BC=8C=E8=AF=B7=E5=8B=BF=E4=BD=BF=E7=94=A8=E3=80=81=E4=BC=A0=E6=92=AD= =E3=80=81=E5=A4=8D=E5=88=B6=E6=88=96=E5=AD=98=E5=82=A8=E6=AD=A4=E9=82=AE=E4= =BB=B6=E4=B9=8B=E4=BB=BB=E4=BD=95=E5=86=85=E5=AE=B9=E6=88=96=E5=85=B6=E9=99= =84=E4=BB=B6=E3=80=82=E5=A6=82=E6=82=A8=E8=AF=AF=E6=94=B6=E6=9C=AC=E9=82=AE= =E4=BB=B6=EF=BC=8C=E8=AF=B7=E5=8D=B3=E4=BB=A5=E5=9B=9E=E5=A4=8D=E6=88=96=E7= =94=B5=E8=AF=9D=E6=96=B9=E5=BC=8F=E9=80=9A=E7=9F=A5=E5=8F=91=E4=BB=B6=E4=BA= =BA=EF=BC=8C=E5=B9=B6=E5=B0=86=E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6=E3=80=81= =E9=99=84=E4=BB=B6=E5=8F=8A=E5=85=B6=E6=89=80=E6=9C=89=E5=A4=8D=E6=9C=AC=E5= =88=A0=E9=99=A4=E3=80=82=E8=B0=A2=E8=B0=A2=E3=80=82 The contents of this message and any attachments may contain confidential a= nd/or privileged information and are intended exclusively for the addressee= (s). If you are not the intended recipient of this message or their agent, = please note that any use, dissemination, copying, or storage of this messag= e or its attachments is not allowed. If you receive this message in error, = please notify the sender by reply the message or phone and delete this mess= age, any attachments and any copies immediately. Thank you