Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2404035rdb; Tue, 12 Sep 2023 00:07:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG++UuPQysFYGqVZYZv21xJiVkeAnTkenkv7RjfJeCheV91koSqT9tD++THIztrPpHlw3IL X-Received: by 2002:a05:6a20:3d8a:b0:151:35ad:f327 with SMTP id s10-20020a056a203d8a00b0015135adf327mr11906286pzi.17.1694502445395; Tue, 12 Sep 2023 00:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694502445; cv=none; d=google.com; s=arc-20160816; b=HA8cKtid/T+0ihTRJr2cgR7R/yEc94I8iIqrrO5TmTb40DhYgtWbRhmxr7bWjaOK20 2X3iPpgNyoujOe8/x/xT6j+G6Ww+xUwIQFMJagT0rE8xh34hs1h3gI+03dE4Afe21woz mFSw35pS8Aefp8Tslg28kVNoF16q9CXiX/UoXUJvfoj5iPXyIfbX6EWp1HSrTGnQFMHY Qo1TdaxAfP9+0IVUY59JBOE7+xQdiHy6K25ovgCucNxrHElsjyQd3LJmDGa422AuahLt WRRYUtDV8a1KaalQh+zbi8B2CP4B5jAc6dl/lu5Hg800GGH5JD84/UngMTlRJEhrmOBu GuSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=rCTsQATJNmj8+P57FTVUvrbfsMxw7f1MGEc+z7YUWVg=; fh=Wlq1Uki4kfiyzrxfdCIyGk1fm9ReJMi8NXkw/dTfA0M=; b=ZabytBe6ddHCvGaaC296mLHAxZNQc3MRp+dCw+45DvYfborrz6xOE/NSwuU6wXN83L GnKz4424fBe51YwbMw56JCUsS9B33iy7/XZjbRWjHMFxM6flAhku/g/OwjdUvqeMkrDU 6D9/65NDNhoMdvu24YsrjP7K/jUYUiUI4vYNwNaKcKLW+4ClSi9q9CRYt1tBv0V75QEG m5xs5E725ea7sCn+O3l12sBF24kN7Yw9Tni22Zt3gPOLgUulmSdFBrWjl4i2J66WiNtG D1/lThyo8EcAShD25hnoltRqWFq9g0IEohQRa72DpjCw3KMmiG1tbt0TUh2S3POq8K0U UhCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id k66-20020a632445000000b0054ff717395dsi7450986pgk.691.2023.09.12.00.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:07:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 322CE806B064; Tue, 12 Sep 2023 00:07:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbjILHHH convert rfc822-to-8bit (ORCPT + 99 others); Tue, 12 Sep 2023 03:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbjILHHG (ORCPT ); Tue, 12 Sep 2023 03:07:06 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F45AE79 for ; Tue, 12 Sep 2023 00:07:02 -0700 (PDT) X-UUID: 4c5f962676df41fd88c33b35345abea5-20230912 X-CID-O-RULE: Release_Ham X-CID-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31,REQID:99d3588d-76c7-47f3-8d5b-9077c3b64bd4,IP:5,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-4 X-CID-INFO: VERSION:1.1.31,REQID:99d3588d-76c7-47f3-8d5b-9077c3b64bd4,IP:5,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:-9,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:-4 X-CID-META: VersionHash:0ad78a4,CLOUDID:17ad98ef-9a6e-4c39-b73e-f2bc08ca3dc5,B ulkID:2309121506533HBDAXDZ,BulkQuantity:0,Recheck:0,SF:19|43|64|38|24|17|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS X-UUID: 4c5f962676df41fd88c33b35345abea5-20230912 X-User: zhouzongmin@kylinos.cn Received: from [172.20.12.156] [(111.48.58.12)] by mailgw (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1882865759; Tue, 12 Sep 2023 15:06:52 +0800 Message-ID: <0fce832b81d676da8bde28bc7acf4d56932f244d.camel@kylinos.cn> Subject: Re: [RESEND PATCH] drm/qxl: prevent memory leak From: zongmin zhou To: airlied@redhat.com, kraxel@redhat.com, airlied@gmail.com, daniel@ffwll.ch Cc: virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Tue, 12 Sep 2023 15:06:35 +0800 In-Reply-To: <20230801025309.4049813-1-zhouzongmin@kylinos.cn> References: <20230425014543.3448839-1-zhouzongmin@kylinos.cn> <20230801025309.4049813-1-zhouzongmin@kylinos.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Sep 2023 00:07:17 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Tue, 2023-08-01 at 10:53 +0800, Zongmin Zhou wrote: > The allocated memory for qdev->dumb_heads should be released > in qxl_destroy_monitors_object before qxl suspend. > otherwise,qxl_create_monitors_object will be called to > reallocate memory for qdev->dumb_heads after qxl resume, > it will cause memory leak. > > Signed-off-by: Zongmin Zhou > --- >  drivers/gpu/drm/qxl/qxl_display.c | 3 +++ >  1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/qxl/qxl_display.c > b/drivers/gpu/drm/qxl/qxl_display.c > index 6492a70e3c39..404b0483bb7c 100644 > --- a/drivers/gpu/drm/qxl/qxl_display.c > +++ b/drivers/gpu/drm/qxl/qxl_display.c > @@ -1229,6 +1229,9 @@ int qxl_destroy_monitors_object(struct > qxl_device *qdev) >         if (!qdev->monitors_config_bo) >                 return 0; >   > +       kfree(qdev->dumb_heads); > +       qdev->dumb_heads = NULL; > + >         qdev->monitors_config = NULL; >         qdev->ram_header->monitors_config = 0; >   Friendly ping... Hello, I sent this patch a few months ago. Could you please help me review it as well and see if there are any issues? I'm looking forward to your reply. Thanks