Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4308988rwd; Tue, 30 May 2023 03:40:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4K2+PSFUw7Op2Css+/6wdkBlMzY9IuQkwPtMhgRV4t0qTEpo1y+PnQ2LNcrx8ffNRUF7WW X-Received: by 2002:a05:6a00:14cb:b0:64e:bada:2411 with SMTP id w11-20020a056a0014cb00b0064ebada2411mr2265933pfu.25.1685443252056; Tue, 30 May 2023 03:40:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685443252; cv=pass; d=google.com; s=arc-20160816; b=SWQC1Cddy6i6Dlci0aDoi6xdA+7S+V65Miafz9TwjNEzZNz9LIqffIyQbvn7B33t1F 53it2ntZcRxvZ4xXh/tSq/KCimRM3s4vspVRNaHQr9eGVXhlF5mP4E5JNW3+HcFxi6lt e8HN0E44Z3CiRdSlp0Q0N1l1wvBBO16WsMLKIVMtx5JZ2B30QnYjdRYxDvwOUNIjVuKX SHY6kvo+9j0LAr1xi1hROt8TzbI6p6uCEGNpTFpImTECFKO5XwaETtXD6DmA8kqUNkWq aUxoXRi4YdG4VfQx0nqfITDW801sbF4cSwWp83AJ4GPKmnXY3pH5r7H7oUCNR/1CkDVp huuA== 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=v+g7zHyQlpi5vDv55vDX8DwbWAOc0Ei4FtxuCd7Jc/E=; b=fPPPiMx01yGEv+LgC7xD9/HI/nny/Nb1/c0wNzP8WrUYhDlnBSOv2hbF72jRQGKH6O WHxiyhLgdAfI6fZRTBPDANSXmtLGC5vsiMtt2O8vAPAZRbEKM+T61+XIHT6fAcUXaDAV V+so3nEbe/EeecCdvnsYCh48tj6TX8Ca2Dszc+9szu23rfCIEcQw2xvoPo6qwhKFVjTn JOZ9+9CQHG7nzCwytRh4O11gwkReHSBI9OOIltN5YP7jOWmM9j4eDb9AYrErt+d3jBu+ hc82ODa69/j0XXvEHI/vBy4lbODI6Pq5ERYLmKZooZKjOdbSwHRe3rV6wswWuEipJTb3 69wQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=fJPeYCPf; 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 g6-20020aa796a6000000b0064d533abfd4si1550731pfk.189.2023.05.30.03.40.40; Tue, 30 May 2023 03:40:52 -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=fJPeYCPf; 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 S229475AbjE3KRn (ORCPT + 99 others); Tue, 30 May 2023 06:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbjE3KRj (ORCPT ); Tue, 30 May 2023 06:17:39 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2129.outbound.protection.outlook.com [40.107.117.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46E82D9; Tue, 30 May 2023 03:17:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HnFB+LEyvzrV5UT/kzy9RW5bjyhl/NI7GyPgFpSCxlO2nkS6jy0sRjP23LKPYY5E7fK/6qssmom4Z+Y5jMfG+cds4cBHeIuuPBgWn3BzIzt1lYPwsTA8wH6wBN1ch02lO7fsyWtJBer149Sw6tjo1EVvNA+XYzt9WBszJWBYPijkoRlJuEnnY1aqQMIB+h31Oh55CZcSnvhpF4y0uj1T8ZBySoTR0zB4lq/ykjtAUGzXhdCmMyETnjfpZ9IYBlakx4Cm68jNo+ucU0fmKw8o/6/8c2M9ZQLypaRXBq3XQvKj7gsEOsihctcwfyvCkUv7J8OFH19WOsklpZ7RubdNow== 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=v+g7zHyQlpi5vDv55vDX8DwbWAOc0Ei4FtxuCd7Jc/E=; b=RNMVz+renba+FQvWgNzPo5vMoqxeAcqTZygGQPGmsUQC6Uryh0Q8juBlqpBB1Pt5n9XnERcStXKM83OrwRT85XDIpsSIJnx1Oh+BzRgAvuCLHnHGtIHLjZVdAuAEpJidx17UgxyAFLdh+VPNBJrsSXjNaCH6wzJXtYvas92GEi9LnbwkSi1rf+ps6/l9B2qDrx7W7fiG7a5+wMVs0o0mNKl1D0HKuw7Fyb0R64LcCYocvLIShrMFIMxLIdRelhG5X7Bb4hYYjuXbq4O+m9YgddTin+B9gszsGOHrfuGFEx1sRD/wvwmDy8AZxTXdtgY+zHzb/IF8Seu/WThJUneRtA== 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=v+g7zHyQlpi5vDv55vDX8DwbWAOc0Ei4FtxuCd7Jc/E=; b=fJPeYCPfm1A49v3D5i9mY3cXNev8r5ou0PhxybU9vaHcqeLtdoVLqNVgJ35FXgAVhQP3auKJu/fiJilFqPioqsQYEKFb2RQjnx9BZAt3J9pZDIHSFbZ0xoNoT+CNKKx6rUSzkp1OEhyoZBi938UQcbJoF9p1+G5NuEhf7dFwb+b4cB/vS+/NcArFzr4FlRrX0BT6XSsO8KaVNreeKxAFWZji1YDofm+cNhqdSkhqVyHiZNt7L68YLwWM/YVxgixAjzshbs3+z1D4+A6ZxLmWa1Fw9N6mPLt+eFdAvX+j3s97rez3GYP1yQkrZ1UYaLuY+ARdixduHAfMRuJKYP2QgA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) by PUZPR06MB6032.apcprd06.prod.outlook.com (2603:1096:301:116::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.22; Tue, 30 May 2023 10:17:34 +0000 Received: from TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e]) by TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e%5]) with mapi id 15.20.6433.018; Tue, 30 May 2023 10:17:34 +0000 From: Lu Hongfei To: Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno , Hans Verkuil , Moudy Ho , Sun Ke , Arnd Bergmann , Lu Hongfei , linux-media@vger.kernel.org (open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)), linux-kernel@vger.kernel.org (open list:ARM/Mediatek SoC support), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Cc: opensource.kernel@vivo.com Subject: [PATCH] media: Fix resource leaks in of_find_device_by_node Date: Tue, 30 May 2023 18:17:18 +0800 Message-Id: <20230530101724.31412-1-luhongfei@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TY2PR0101CA0009.apcprd01.prod.exchangelabs.com (2603:1096:404:92::21) To TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6697:EE_|PUZPR06MB6032:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b71193f-fd70-4f20-7ee5-08db60f715ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J0Zw9Bfds2S/7ajyOj0GQSo6gdrlpm4MxTek7I1cHRwnyLXG2OooCwHI+pCyK/cCq+KXPAuKuYvU3Piivj1WWcg/89HxcFt7Zzicx/C6qf6ouOFLNOyxc85xqvg6BZLTghU6eeFCv7sAKaL4XzK2F/++GtmauJwFKB+96pjPTZt0tKysl6dwBd/GswLqX/AMrxKbs4qqewb3UIOXiXdQBOiB5AOGXnqGV9eMDejtBGXK0pI97drIcPZ4HAntyZJB+0JO/uEtrfDN4uohA72xN6/Hm/2RAlSqvHYD8dSlfnJHDETyspFzP8zauG1NKD5uOoLlTSQl4T3vEosEqkgHGvx90y/lq4mVrriZi+QmZ2VdUaSZGxfUBJTmWK2q8SqC/CssTw1y00MKp6Y6YS/yy5KM86DfsTy/EM3VwzuQTVJ8rFLfyozWDBc6qJa5fAxFTSD8NUwJdvmAHj/HlA3dVhTCbOwpvzPsqYk9UN+4fIlGNCK4ryguYgjTc1VrtV2a+924wW4duhTcvXk8fnpxy2Tcs95SCprLCxH2fDdnz7mVzXkLItSE0bJ7KD1qJh6hmfLmZzCJunPJetDE6dqUUW5vL8fihsJu8quFxmB/W/SNZUqKgkWQGCBpajFxKQ3f X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6697.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(136003)(39860400002)(396003)(346002)(451199021)(478600001)(110136005)(8676002)(7416002)(5660300002)(8936002)(36756003)(2906002)(86362001)(66556008)(4326008)(66476007)(66946007)(921005)(316002)(38100700002)(38350700002)(41300700001)(2616005)(107886003)(186003)(1076003)(6512007)(26005)(6506007)(6486002)(52116002)(6666004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OvJHRLUu+NJQ1N8cHr+mH0rY2feN0donY7dLKU954CkzztGdJCxNJWV4qeqG?= =?us-ascii?Q?JbrfWLwBX1VuNIAx1D2DXTsXOw2OZftFqbgf9yzYrhCC66Bg9PJaZKCgUAW+?= =?us-ascii?Q?38iG7y0bDT5wS+gNgnFLTxM0f5lS3B3Ev1Ul80XStB9elGw/N8ngswrL7JG0?= =?us-ascii?Q?dqBkMiBHQPFOch/FYtto5Blmx558VXAyntkzwfnXScClYPKlOXcfMq6aielM?= =?us-ascii?Q?mYrsD9JNnp4zjlr7Y5SHVWqJuUSSjxqm45YWtmiQJ0YYI7LnYO4iV8ImH8Oz?= =?us-ascii?Q?Mp24XjQ+mWgb4HbWUrwOZX03842NdsT/kN/eJyNWxhBi+JuP2nWyN3OSqr84?= =?us-ascii?Q?kNxbZv1iQ2g1Gc8qpOmWeOP8o0lBw3WKLTL5bd7afBi1PbfJ4zWaTpBxtjaJ?= =?us-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axC0yLqclUh11KL9dyMWD6?= =?us-ascii?Q?QiJdC7XNn0Gqsd6ddhS43aBc4lCECGqXn7h/3iJlGmwcn2fwhtMlL2vCUChY?= =?us-ascii?Q?0VKlrcNUZqYR0UIAeIcuwnlqAbnNOeZ2mURZY9132yFdQLc6f4wkMGL4qJWV?= =?us-ascii?Q?FDGmJL611gofrxm3D79iqQo7QPTq5b5d63KevrcwySiKofvnsm69lF3jYAYo?= =?us-ascii?Q?qAwld9NuEzaL6LNVMItdlpTQ/+un/0+YahegE3J7rEFDsNAih0sVh2FQS2Je?= =?us-ascii?Q?pln1z09n3qjYhFmokunGL46aB+PUyUzIMJEB28uQ?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b71193f-fd70-4f20-7ee5-08db60f715ee X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6697.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 10:17:34.6622 (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: 6JHC7MzLp71kFw+SZzcs1tqyY04mLVEKgv2/5nHSoM9FuPhplnAHzC26gbuezG1/VjDAayu1BhmvEJwJ7z7XKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB6032 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 Use put_device to release the object get through of_find_device_by_node, avoiding resource leaks. Signed-off-by: Lu Hongfei --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c index 19a4a085f73a..1fe10a21e395 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c @@ -892,11 +892,13 @@ static int mdp_get_subsys_id(struct mdp_dev *mdp, struct device *dev, ret = cmdq_dev_get_client_reg(&comp_pdev->dev, &cmdq_reg, index); if (ret != 0) { dev_err(&comp_pdev->dev, "cmdq_dev_get_subsys fail!\n"); + put_device(&comp_pdev->dev); return -EINVAL; } comp->subsys_id = cmdq_reg.subsys; dev_dbg(&comp_pdev->dev, "subsys id=%d\n", cmdq_reg.subsys); + put_device(&comp_pdev->dev); return 0; } -- 2.39.0