Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3211049rwa; Tue, 23 Aug 2022 00:12:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Ni24BdGoaIHS9xSsnlpac2Wzzk81fQGwMXVvuqa+JWHyzMGg0ZCgsJyUiBwqcX8Ec5xqn X-Received: by 2002:a05:6402:2989:b0:43e:91be:fd20 with SMTP id eq9-20020a056402298900b0043e91befd20mr2486163edb.109.1661238766048; Tue, 23 Aug 2022 00:12:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661238766; cv=pass; d=google.com; s=arc-20160816; b=b/YG4iG3yxK+z7zudYdeyHtC5LM0nf2ivbXN55AMhP1ZrrOLvtkFBpUanpn2DQaAff PiqUdQKrsBjJ7jP4/wrryR+mZuYpuho3xN5WtFfXbp4o1T3DZtdg8nOGCMY0wiE7DaLs m9nlvEGf+uoIEKXAbIIZPnuAUeeND9FZh01w6WwNeSj6h9bCC+IFpnpEAy1gr5JzlF1U JNP2vCQZEMI/Z81b1H3inMSVHZsuGtacH3KR/zY8zGsgFh1S3s0K9wYkwWnFpd7f+/mm hZwxVEFHcGkip27kr/1iGLbNKxM/DJwVtVwJl01Ni+DtgkabuQ9dRyn1ZUl1q86CND2W c2sw== 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=nCzERmU4tZLX+SaLWDISqy1obxi2measjENwVuU3dnA=; b=CjqjgMJ9AtV5zdkUazw3kR3ki9pm6yHzGkPG6IYcQSUsfAKePmb6xie84m5e/ub9jz gOqRemM4VHpSYrzqSGJQtSgKUJ9XrVumnLJ83Z7+G+h9AOWH8Jbgii1tlzO1p3B0KFWt E29+WxIFmJCVXxuOXEp3xLwON5/yjrFqtqOu4ZY5e9iFgDkcrjlWIzPiBQA34x9Q3jc5 ILKfMrfw2zbZKDiKcEGc0my7ZZlhLxnEcTtwXSArcFEDfA6IHVhI2owt5IXtCV0wrp7E xSWSwSsXk52XKTzGNnFO34VgapNdMDJgFUC6w6QIds1N+v374DEVfO9OLWJx5riMl9tR 6VfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=BYZ2m9cP; 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=fail (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 hc17-20020a170907169100b0073d8650d612si4034125ejc.374.2022.08.23.00.12.20; Tue, 23 Aug 2022 00:12:46 -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=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=BYZ2m9cP; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240307AbiHWGuc (ORCPT + 99 others); Tue, 23 Aug 2022 02:50:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240315AbiHWGuY (ORCPT ); Tue, 23 Aug 2022 02:50:24 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2118.outbound.protection.outlook.com [40.107.255.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 081CE2F026 for ; Mon, 22 Aug 2022 23:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GJE4wa6T7tAavbtzuQ84ZWk9ySJ3buLk1TMV5o27seRJnWvo49WxpkifRW6kza06EjrKxYsnNEBTKSu8IaLND7+k2/OdVeJHP81a/C27yVFOxanP3+jgQeDuzL4Q2WRXFzwKeHQjWu39TNyDR2fifC7sgHhVeBmvF1+cUga6ycBW4pi/RdYCwLA4oom1Tht31KF3153qgt/2sQRt4ilCPr4CjPpBxrOGFZ2leyuWpyvt/uhNYRa+QnHyijD9tJ1Y4Xli1BKDH43SL44fJ6j+SdfoI2Pb7/YwKxRHE3GIbjBSDwPh9p4bUdFuhnBW/AsoEFTsx48l/olm64+YO/X8iQ== 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=nCzERmU4tZLX+SaLWDISqy1obxi2measjENwVuU3dnA=; b=SuB3zvoYdoH+8VZNnOIV4SsVlvyZUFfKX1wikw5/6cj5pcDmTucwy5I+ik9mzJcuQWen2GJoFZokrw9unSAyAM1cBcqcFqarOr1j03DsEl7/CERXo6qkI588ZH3XVUR22Ms0tQI+FBeZDSmlVZ6EFKeN88klDS0/laGQT5iAVJu5pxlkWsCbLsveii+L2ypraOzC5z/zHCZLYOLRqC8aOedBqEpA6JZAjdacx2D6LmWmdhI+WTAorRogUMFcAwPU6d6V/gHpEHlx4G7JVdwwiqcwAOfL2H05ac4qRnik8dPl2VM+0p4gO30PMIo6V2Kw+ma2P5hYrzepF04rVYMe4g== 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=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nCzERmU4tZLX+SaLWDISqy1obxi2measjENwVuU3dnA=; b=BYZ2m9cPkC/am8PE8ltGJ9D3f19fevwY6Dz6FveDHBq0+ygpmga8G0FH7Oud0pUJ5KDqiOOxjTYboGA11XPcpXR+zFc7TLFm7rzR0WarKFKN8p7wJGw+5mZNhgjwBkSu9PL3vWocs/HG3qGjCeaTSGZ6qauFx/N9MbXT2vScm+k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PSAPR06MB4021.apcprd06.prod.outlook.com (2603:1096:301:37::11) by TYZPR06MB4269.apcprd06.prod.outlook.com (2603:1096:400:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Tue, 23 Aug 2022 06:50:20 +0000 Received: from PSAPR06MB4021.apcprd06.prod.outlook.com ([fe80::5c66:2101:a7ac:8df0]) by PSAPR06MB4021.apcprd06.prod.outlook.com ([fe80::5c66:2101:a7ac:8df0%9]) with mapi id 15.20.5546.023; Tue, 23 Aug 2022 06:50:20 +0000 From: Bernard Zhao To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Nicholas Kazlauskas , Eric Yang , Michael Strauss , Fangzhi Zuo , Melissa Wen , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: zhaojunkui2008@126.com, Bernard Zhao Subject: [PATCH] drm/amd: fix potential memory leak Date: Mon, 22 Aug 2022 23:49:56 -0700 Message-Id: <20220823065001.16872-1-bernard@vivo.com> X-Mailer: git-send-email 2.33.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCP286CA0072.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::20) To PSAPR06MB4021.apcprd06.prod.outlook.com (2603:1096:301:37::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0284e37d-a9f4-4aef-c2de-08da84d3bf16 X-MS-TrafficTypeDiagnostic: TYZPR06MB4269:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGb+Gv9Wr3K5hoEwqM6zdlVAMdaAbzpztJzQIsptWfQhysh7kTCS7SOQltYUJua01JICHlKDPRrQ7z8yv7KdqyosYfvXpyw6rx9MjNTBd944OeDxapfU53S/5UGJl5y5K+4F8Y0tG521sjAKRBhfcdQWmCJxBaQBwFNLTYe4pl54VVzYSrLug2aGPpx09hfvuPmDsoXS7Nd5dFLh9zbES431rRlwjK6Gf4d0+WnHznsXeOTucFvf/9G9ju0SN8p+VAaKOpSPWUgeJnrimHvr0bwQ4L4suRGIwVNLYQsbxWBzjK59+WStVod/Fcm66QlG4NX2Fnz04+17dGBvruJqZ0nU6sLVJKjYgi9KQA/d38LR2gkINafKXywB2LLSD6kwrpomqdVDY161Ua2AJiko1Ft0LNWKlefnqEJ1krDFKSiHTpSf5Li7NW7uO8mlmF7qYydk1iLzvCQOOkBXpo9aKYhbonHOtOUUJhcmzmHI578jy7GULqZ+Sm+xB/HAlXz72cSIoeYbNWg7R2TWOimYEKTG/U/fvhkUPbNSQP5rf79NCmzIFLs8i1rVxebpBX6Hwpt7K50NvzhVYJ9iUoj+UmFtjHKqcTbCPtsOLCpBBw7Ii13ljQtPOn3KpIXEYvu56nYmQwpnBUQN8uYpsHkZaF98sKPrmIoyNEVzjYtlpIVS4cZHL/sfDl0aWifyUTAbW2ZzWi11PQ7UTVPmbNmuPBFXsZarEGadefvnJ/1SHJQsDMyDGLcJguvtHer5vYCMsl4w/UYQ3IsxwrbuQLl9ZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PSAPR06MB4021.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(376002)(39860400002)(396003)(366004)(346002)(2616005)(1076003)(186003)(921005)(38100700002)(83380400001)(4326008)(38350700002)(8936002)(5660300002)(8676002)(66946007)(66556008)(66476007)(7416002)(4744005)(2906002)(107886003)(6666004)(6506007)(52116002)(41300700001)(6512007)(26005)(110136005)(316002)(6486002)(478600001)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xtpYPKqDF5St+bbx0Z7y60WFycyVJOdRuDprDf4rt/wDY+FFmsI/LGBGggJV?= =?us-ascii?Q?XEjmfs1pyNlN3Pc8GEU/WIhmEkAYZP/COo4F3WIFgVUrmt+adMOH0JatSs2z?= =?us-ascii?Q?NmfuLMtL1hyDRZwyW2hkdlAztnRXMWZosmvKuzelGsbmlSjkJCmuPoP9y/rn?= =?us-ascii?Q?PvGcHrOE7Y0v61X5ipRtG8iEoC/UtplZercpNBwa3qNQ7fdb9LewtmMH14Yn?= =?us-ascii?Q?Bp67oD9dz/pE3ajg4i6JBAfJDyPTRXiJtnqPHPj7uUvxkFc4DP7AeMrgl0CD?= =?us-ascii?Q?nyEMej7HUiA1yiqtxV+5Tu6c1qO8sRxxYVWcNMxKYg6XiooZ6tnjEcCxH1Jh?= =?us-ascii?Q?EInzZ5Qjx+Az2yEkRT2hYgQUETMo9pdZzzxxRwgFDek/k9ZN5QpHmspnXxMh?= =?us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UrBRcrKVgYRBV0oitQdrnKVchTUnvb?= =?us-ascii?Q?Ten64N0CVhCnOTrO2Hok8iGXD+bMSTCkQKWvDrYZqs1urjBGlFR7LxkbsoJP?= =?us-ascii?Q?l5VYIBmwtLmlEcTBrUd/tY3IIiq3aymzgELH1/1c2R82wphmkRp1DU69grF7?= =?us-ascii?Q?cdkls1egBcbh3Xa8XMzLYUIaYxAuu5g3SRB2spR9/z97K5bR8lLCF4AMQzpn?= =?us-ascii?Q?mPtgMakz52isR5IHDzIjp2JK2twOJklzJQblZ0iGlwP3rQdMpIusTiMvZA4p?= =?us-ascii?Q?iAZ2u3DvVMC+J+l/4svLAvxuRFD4NuAgBO3EwsGk?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0284e37d-a9f4-4aef-c2de-08da84d3bf16 X-MS-Exchange-CrossTenant-AuthSource: PSAPR06MB4021.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2022 06:50:20.6970 (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: qbD12c8tRZxlAxD8jtRsfKKPwO0xI7DV6OIglPA8JGISdvfu0i9SZ3h7ItlHgHInvmUM2Mi+/UnS5m8bK0Fn3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4269 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 This patch fix potential memory leak (clk_src) when function run into last return NULL. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c index 85f32206a766..76f263846c6b 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create( } BREAK_TO_DEBUGGER(); + free(clk_src); return NULL; } -- 2.33.1