Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3197939rwa; Mon, 22 Aug 2022 23:55:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6K2Iu2EJxqI+1KEzJHpeNwzbT1+2t4GFVYqMqd0rslG7kl836rsDF2HPZ/6Fc1W0gBTwuP X-Received: by 2002:a05:6402:f21:b0:446:19c5:59ea with SMTP id i33-20020a0564020f2100b0044619c559eamr2392503eda.371.1661237723566; Mon, 22 Aug 2022 23:55:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661237723; cv=pass; d=google.com; s=arc-20160816; b=QB+lMD0KjMnIhRDnuUejv0NZSyBt5it1ntr74IixShCEzuWfLfb+M9N1UYgtafOvJK xrpl0j+KUwknhqnptxZ680pnplxyny3kJHmnxPgldPZUGv4t3gGg9lPznJESdwb/nGhB WbIgc4F0jwRU5WJCw17ml0+KlKCdNiJqrByBX3FPTQMtk3cXMJYRuis6ajoG6IyVyoI5 oUh5tvpWsLt+HRSOe2jRMyzhaA1qmy0BW3+86yQNlj7sNuNPbgileLQmMkxESxn4T6vI HLnViknjTjo+ruFWDlfRLl2u6CKUKz8LQP38x+SCs++ZHnvdbO05FpUieM+9F+noZOTe VNvQ== 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=X5LUovQccpJe0MFDSDQELkAf1XhNXuiKvAoB7LUXlS4=; b=NaMrTb4FLejSXUQDW32o6xzAKxi5FXR069bQFYGVaY8owMREbLebRzTi6zqaou64AE XjdFyTrg2EG2nkeDwnyRe53jB2maZFbeJtYFc51rQz5QtUNWaa6yGWXWRnnmjmWgcWpk Elzg6KsPbyv1gM0ema6+6QvzetMJ9LBHd875DA/tuermUhDl5tqQ5525bBRctBmq77uz rWdvEt2+b7QKXnEUgYr8Z2AvwgwppZlrcb5VvvA/ymW2u3b7+44gCC8btQaXW9vRdgdd JxnUyReR9m9cfoH0/Sf8ssWAgz6Hfp6MGJvj67GJ4/TT5zKeULVIxJq+f7PFfXuXIX+6 PADQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo0.onmicrosoft.com header.s=selector2-vivo0-onmicrosoft-com header.b=NmaR3Xr0; 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 g8-20020a056402090800b004461a2cbb05si1184248edz.394.2022.08.22.23.54.58; Mon, 22 Aug 2022 23:55:23 -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=NmaR3Xr0; 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 S240694AbiHWGgR (ORCPT + 99 others); Tue, 23 Aug 2022 02:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240664AbiHWGgK (ORCPT ); Tue, 23 Aug 2022 02:36:10 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2137.outbound.protection.outlook.com [40.107.255.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4850361121 for ; Mon, 22 Aug 2022 23:36:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JSc2oSSLV+x1acIpNXCOopNk4H4+QES8Tte7/+HTtkilw9Of+TZZd3lPaKM7B9ZS37V7CE9ilwlPdTOOQujl98RPlXy8z+KkmZ5VSCLnV3qNdbnTC5DvBni7KkjDb2c/nbMZqGMYSpPQtgJUeQScBPgJrEVmRaqh7N2UGynYwLk7WnxVfPR8JZ17xlGSQjNT09oZAo9MjcRtWgXeQgmvcCxEs7MjuLOblIDDpwHuag694ax8L1CyPIfPqN8geuiyJB5rh2D2GzSSphU4eWYbrM9vdkPsKod6d/qq7k3In6CeojwRWhdp+KVHZahP3kqveWTl/9XokeBKKrjd7d0d4w== 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=X5LUovQccpJe0MFDSDQELkAf1XhNXuiKvAoB7LUXlS4=; b=FIvI1V9qsqPAQOsTuUwwfjWBruzVb+PmyOJhshfbTMQayxrtwOuqwZ/CBvizRFPBk/DaMifnk4yqSDIPHgMrpZWN7alhQkGeFYHZxb1jHWJBneLJ4H+gt55wpav2VCxnctfx00MUo53DQuY5u66bOcxwQgBDADzt5nTg/3jw0e9ZGlyDmuLn4Ttj/V+4YioQp3hiTD0L4Js/mkuMgplxqBbRUCS27xf/cgdx8RdklsxyU2+pXNnBuDPahouJ053q8KPdlAQ82/hfGOmp2VeGDDEWqPuPfGc5COrnZzxsOVsH5zqz8U6FtT3Bcnkid3/+uIsHSvhcODq1zyHhH4GyDg== 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=X5LUovQccpJe0MFDSDQELkAf1XhNXuiKvAoB7LUXlS4=; b=NmaR3Xr081TZEljpW+VJQwANjeIc3w2tKoJmAuplhD3UND7Gpvmc5pUvrv9mtyWYluZMjErqczpslzeOYzXwdBUBCfvd2gpiWehLFJoUaTWxO25U8qcnUC6ehhJ5XP33ymtht/p/QR2wmcyArqe1/cUwAqN7yvM+PDrp6gNgUA8= 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 TYZPR06MB5027.apcprd06.prod.outlook.com (2603:1096:400:1c9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.22; Tue, 23 Aug 2022 06:36:01 +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:36:01 +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:35:24 -0700 Message-Id: <20220823063546.11499-1-bernard@vivo.com> X-Mailer: git-send-email 2.33.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCPR01CA0020.jpnprd01.prod.outlook.com (2603:1096:405::32) 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: 74ecdd4f-083e-4df1-650f-08da84d1be89 X-MS-TrafficTypeDiagnostic: TYZPR06MB5027:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +4vlntq/G7aNpcLMzSlbhivFP94u5TM/15YjE7kF9Hj12WxyNTcSnWNPS6NPSv/gOtygfe7ayGJgjYgJel1rRXvZ2JCM3J1Y/4+7NH1BZK1ruqu36BfbCzjzIaweihfGoh4mafgqK57WXn2SQeZa6Q/0XjQfvxoY4IrqxgTr1vEsPkHvqQE6c90CXDFuQ1l/kS9pxbvVTiiV4L/11l2KGGzkzzC1Vu3g0DE+n1d/jxeFgHujAhMAvSZ81a9RJ2Ggl1M+8Z0GjKEUfdm9jJEP48NpNxR8HgtAnu4+1mczHOacB+63kYDktGVhuw5v1QTw/17QvFPObrTHQzXBCIdk0La0yrdwoh1YcmWbMgEkqcDY1H9rvALPCpJ+SvxI+0Q+LJAnStlY2EhUA4BqPYtTh6U55M2RqtraKqFXq996y/lJSZ14dhRPDNSMgcF5e6FUbKDZYT0k1XmnOivvY27I85iHqYvG1rs5CC0JG4JSBBjltw2rrF98Mw2Ok+Yjhken3ZSl4qfm4ArO7hWVMl9wyQgjjER9o2k8k6AXmAAvZSNCJVLpM7yLok+lflkIiUpq8q+qoOtTX7KKywTfOU34fbqb9ysvkn8cJHTgZXIB3oiO/q8UtGwXFAhH1PULB0WaN+IG0Ya7d5iPslwXSQs6GKYfwmnpceq4Ql3592CRkh3K7dS+aTeB8fdTe483s2dvPUUqZn9+B8gP1wVj1/8g7JilpWeciGQf2wRE2g66WIoXYu+mdQwWsM2jXZ8mZNFIm0IGU45VUND8dg7TdUOvSbF2oNpN0cEVl381fIyIU8Y= 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)(366004)(346002)(39860400002)(396003)(136003)(376002)(66476007)(8936002)(8676002)(66556008)(4326008)(86362001)(110136005)(66946007)(38100700002)(36756003)(38350700002)(921005)(1076003)(52116002)(83380400001)(186003)(26005)(6512007)(6666004)(41300700001)(478600001)(6486002)(107886003)(6506007)(7416002)(316002)(2906002)(2616005)(5660300002)(4744005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ECkGCgwNMvetFLaAxHm9ZHMLAFavJENmWq/f9hWTRCcUAii6fk6t6A+kypVm?= =?us-ascii?Q?/MsU1uTBr2CPIjb1KTBdfT3AiLPqPPuAg2O0w+HAbduuJew8KgRDucYa1Rgr?= =?us-ascii?Q?QgAq48sbd5hlzDskr4v/5PEoIh3jthjvoq4ijWS0G7L2udz/r/tG0I6GlUX0?= =?us-ascii?Q?cghWChlizflekW3LejfHFKmYfMefFvvtuZaTsYtDXXy+7tpVGfvaF1lDcu3k?= =?us-ascii?Q?xSk5hdZ3+VSvS9JweJXrf3MbCMcNDsx52XXr0YGgcEJLABl1Qjf2vI77BjCR?= =?us-ascii?Q?gs/9G5nD19sEcIYTmx88TtPkVmkVnujcr/w75dvfgmPsrdyKpaISur3hmT5R?= =?us-ascii?Q?guUYIgsfdbqSvD0zP+DKyi9Z/c0zDyJpT2u9xwZlQhr0hQvCdeoBhx/gHzas?= =?us-ascii?Q?1RGViZRwbenSqiuxw873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xR?= =?us-ascii?Q?WqAA6Z2Cq3LQJfjHn+SdO45KoYmqqoMwRVrR/wxDWNOv9HL2wl/5MWrCKjye?= =?us-ascii?Q?mK0Q/0E8tBwNCpv2BGZRwRAeB2DuirjmI3HSWpGTvL7cQl8l8aKJJUoNZ5+I?= =?us-ascii?Q?M5rEK1RZrBPxw2URjXdvTmvp5mg7UiVYhpjybHTvJSgIp+yJXRc3GOMLS/7/?= =?us-ascii?Q?m6tB3CMH5X+BnT2y0gSLTmmnVGkTGcYZ4UHql1/pSnBzcz6Jr45C6di6rrYH?= =?us-ascii?Q?T3hN7MYG1Qo2NDMh5b8SqLTXn83Av9kfhWD75i4S?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74ecdd4f-083e-4df1-650f-08da84d1be89 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:36:00.8619 (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: 3MQvWH+2lviSWfbYCwOa1+Qr8vlBLrN04eZiniW5ylXAd2hxJHED6nsscMSLfMP9pTo/7XdsQEXYoHMckkn0yQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5027 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..c7bb76a2a8c2 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -1643,6 +1643,7 @@ static struct clock_source *dcn31_clock_source_create( } BREAK_TO_DEBUGGER(); + kfree(clk_src); return NULL; } -- 2.33.1