Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp797007rwe; Thu, 25 Aug 2022 09:13:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6tLINoM4qHHRJQwyHP2hv/8f/97vNXsadFewZMQpHqZMPaWiIbrOlsw0FzWQgMa8a9LYPg X-Received: by 2002:a17:906:845c:b0:730:bbf1:196a with SMTP id e28-20020a170906845c00b00730bbf1196amr2946609ejy.13.1661444012726; Thu, 25 Aug 2022 09:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661444012; cv=none; d=google.com; s=arc-20160816; b=tefFM1VoAbFZzKVED+vRBNo1b9ZvdSVVQfBPJPkuxWi25IqTuN/cIav6THW8lP9CGd iu3SVfzugiuDWdmCx6X0+ciTTJEXnG5oNaPEHudpAO6D8O1t6SBs2S27Md0jaJCwysGX 2POw5Lzy4Z0UVCuamm0tI8r1TYhW+kqoa/bxD4Kxs3XqFTarO0PcOsl8NmSF01G9bP1D 1sgWE4eOQyb5S6DqYCWJ/dLzPYtM2Woju++YzNeqFh9aVuFfLYnGmoXo4jYdVywlDX1e Qs0RLBwesS+aSPjoJ2woyyR9gFfRoA5u7j4uGDE598f2TS/S62un6g6Xjbi+gyrCiB+K prdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=j+VXQR5pjPp1qqY+mCv39sQii/lw0V0SoJNg1H+SGfM=; b=p8m3DFAqHoaaSqCvpgcA56SZNLshktJhV1zsJK0Y6HS65mbYJKDQVXI8E4QP801U4E NckrC0FyzrSMPoQZt8i6pL8Wz+RgenxFL8EmBs+jP2p6hVjqBySv/A1dU6svZNNklIP3 2PRDmNBN/2nKGJzu6dj4ydocGm265am34V4RhDx4DMOZSNFMtJvxcUe9v/bPLUhbXcRz nyB0HrFWE0DhhPztqrfii4O1O9pgNymh4o9RRBWP0e7+0iswAmx2t3DyhUb9H0On+BVF T0Ayxz5N4aE22HsQcuyZ6mNC5b8DVooC/D1NxxhJKRwdVx+9yAAA3maF6PHAuPwY9NPd i3Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eWFooHpe; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a17090658d300b007311135dc53si4942020ejs.809.2022.08.25.09.13.06; Thu, 25 Aug 2022 09:13:32 -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=@gmail.com header.s=20210112 header.b=eWFooHpe; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241679AbiHYP65 (ORCPT + 99 others); Thu, 25 Aug 2022 11:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiHYP64 (ORCPT ); Thu, 25 Aug 2022 11:58:56 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AFEE895EB for ; Thu, 25 Aug 2022 08:58:55 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id r1-20020a056830418100b0063938f634feso6992129otu.8 for ; Thu, 25 Aug 2022 08:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=j+VXQR5pjPp1qqY+mCv39sQii/lw0V0SoJNg1H+SGfM=; b=eWFooHpe7iAYZmgL7/qWvc3KXLQmoiNDPoqUHkukC19j0wOKbMKmemC1mTNeKVXUso ojxe6R/tAxrGpuTv2oVQGI8T8jcsPUTWUwZbj4lcH4lfph/FD5riUcepD6gfaCZtN9JM +ofJfbxfxa9de+xdocWonrlW6B9Lqvbt7x4NwkTPIx/Hfb+j4uIrlSJc71VRxgJ5mYm8 FDzIeN7sfeAB4zugNatkQelVC7etlJlwrQLNU9G5esvOtepXQZDNJuP+Vj+JFhH73JML FxjChEAlOgpw9PBR8eK3M6Rfa2LpPpDhD9Hv4F+kL0gz5HRE+pQtp4bB+kP8VJAhcWUq 2NiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=j+VXQR5pjPp1qqY+mCv39sQii/lw0V0SoJNg1H+SGfM=; b=Q/qzGdMK5nY2HJyfZIKpRzDj0pWrqUtawUQxyQ6KKVje28W0rluyy69B+Kypcsx9/I aXjGqK2OGyCYWDLSwBWRDAkHio2zyUgH212yo6Gp/SxXMCn0r+pov8qSIoKETVZ1HE+6 RZEMlidk9mAtKSMtIaLnHCz+5RlLNrZ3NiyF7MlC5GWiGNY8UeW0Ddj3UoEjmDXGSjJM kyQQSR2cRHkO/gmz8mkDczupJmlWaYqd7L57LpBZnM3o5F+3SlB2Q8vBZuyYnLi/a2TG atkSElhOkPl3ZlG/zHpzE0IXIXi49RDZMx/k9k/LkOld5nWfUCrWY7y9lVPcx9ddfO/c dchQ== X-Gm-Message-State: ACgBeo1Wva3c6Tz0EPOXwlFfMWWzDrNd/FO3ulB7TTpI6TGUPi+RnaJ7 RxBJzXGq0c3ml5xTKUFdSP49Wd7Bg9ptJ4BlWD0= X-Received: by 2002:a9d:6ad7:0:b0:636:f76b:638a with SMTP id m23-20020a9d6ad7000000b00636f76b638amr1649240otq.233.1661443134560; Thu, 25 Aug 2022 08:58:54 -0700 (PDT) MIME-Version: 1.0 References: <20220823065001.16872-1-bernard@vivo.com> In-Reply-To: <20220823065001.16872-1-bernard@vivo.com> From: Alex Deucher Date: Thu, 25 Aug 2022 11:58:43 -0400 Message-ID: Subject: Re: [PATCH] drm/amd: fix potential memory leak To: Bernard Zhao Cc: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?UTF-8?Q?Christian_K=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, zhaojunkui2008@126.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Applied. Thanks! On Tue, Aug 23, 2022 at 3:29 AM Bernard Zhao wrote: > > 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 >