Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp909706rwi; Wed, 19 Oct 2022 04:37:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7lwJsfmsjBCSzF8+qRCe2Oo5X8zJWy1uj9Fe835DxTn/3SSUa3IaKH6ANfqAhDZ2ZrhDu9 X-Received: by 2002:a63:f921:0:b0:46b:18b:fe4d with SMTP id h33-20020a63f921000000b0046b018bfe4dmr6966846pgi.573.1666179476432; Wed, 19 Oct 2022 04:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666179476; cv=none; d=google.com; s=arc-20160816; b=S35hgL3cKa5CZmQua49KiiVQw/Ynx/u652Oz5XFPR0Xkt7+Li3/skP7/rK87iONZwh aQy0Nek1BPVr65e9sYmw4u3Dd/5AHelFgqQNOFcK4aigFxE1bqstHSAbXyuIaL+57wTl ts63qAIqjQ8Sbthw4UUmOE3d03U2Y+5OKskM2pA6q/ixTPxs7Fp6FDcs0JWTaknEAR4T n0up4q2fH3+K0XOPtTO23KGNjA8SPTJaQg3a1j/CGq4cmDc1oOy9v0XDZ51yvGM5CH/A lOFLT6YFKtAAPbJg+rfkB9ys9nnKk1Rx2DtYk4LXz5NxlbdovhmCKAzj3EFyHRpesvVE ySPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T/YTsnZib1kMY0VYlHECbumaiPEs+Cj1UvlsH5zTMz8=; b=Ll8zge/d09FG3mnXqMtgKw+J0F7Q8l9UiWbHxXyAQXXuBuF/afh8t9nmqW7JEZ29PT lRWQpfDVjHNyU2qMCcFCG8S4MROGREuMDz8siTrEQ1K19aTPqpkBlnDt48d3b7gfG/x3 eg7bqULyslplYEanqnyDbkc9hIXxSJXOUo7/8uwzfwkqCjvOTARacHqr/GVE6D2eOUdJ +0bXCOKAW9R+Ep2L8/2ZDNOk9lOZQ/MgZv8dR9wLajEHPBMZK9giodY5Js0xWrVJ1xZr bTuxQKq5jitbh3zNzH7SSrK+e7AplZaJ8j5nLAYJCbNuXkWILwtAH/sxbn6B29vMQu7R f2lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WIfNX64x; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k128-20020a636f86000000b00463dbc5cebfsi17022452pgc.67.2022.10.19.04.37.43; Wed, 19 Oct 2022 04:37:56 -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=@linuxfoundation.org header.s=korg header.b=WIfNX64x; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234750AbiJSK4p (ORCPT + 99 others); Wed, 19 Oct 2022 06:56:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234643AbiJSK4H (ORCPT ); Wed, 19 Oct 2022 06:56:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E67E1DF39; Wed, 19 Oct 2022 03:27:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1F72FB824C0; Wed, 19 Oct 2022 09:11:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83E79C433C1; Wed, 19 Oct 2022 09:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170660; bh=aNGCEolK+NBSlxH63pf5dpYKtguBt0WmtFibHave+zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WIfNX64xA4LpwsAYX47F5cctsfN0knfsh2fvR2hiwBGhk9OoptSeLbWtNdaSTxBZr 0SpLPMzegt0itQNaWotKYWpTJ9b7MBrgCj/EczDGqaEhRL5mhCYP51AXrhPO46KbWr qXVrtBxjigVTaYPxRRhw6Yu2aKPJ8VGWku4PtmGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bernard Zhao , Alex Deucher , Sasha Levin Subject: [PATCH 6.0 738/862] drm/amd: fix potential memory leak Date: Wed, 19 Oct 2022 10:33:45 +0200 Message-Id: <20221019083322.561013906@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Bernard Zhao [ Upstream commit 6160216fd2c97107e8a9ab39863b056d677fcd85 ] This patch fix potential memory leak (clk_src) when function run into last return NULL. s/free/kfree/ - Alex Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- 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 3cd7c91655c5..6d721fadcbee 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -1720,6 +1720,7 @@ static struct clock_source *dcn30_clock_source_create( } BREAK_TO_DEBUGGER(); + kfree(clk_src); return NULL; } -- 2.35.1