From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3C5FC07E96 for ; Thu, 8 Jul 2021 16:59:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 963D161874 for ; Thu, 8 Jul 2021 16:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230111AbhGHRBn (ORCPT ); Thu, 8 Jul 2021 13:01:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53976 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbhGHRBk (ORCPT ); Thu, 8 Jul 2021 13:01:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625763537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1+MxxEIgHppIPoGs9NgPZPuRjgmYFQ760KzTDD/t7B8=; b=OO7SaQnWeN6Dpw4mLfL9P1duZTrDE9/azbildTwa965GJZjInR0D2l7arg8STAUD+HcZfI NZpeKU+YGenyS6Gjhe/fjBa+xAxkNg8+LLcvXNJtEECGtjEY6yAZ7VzpJue44sb0eO622m tNskAAO/mkM1d+butG1B6RcI0j2OFmY= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-uWoQXdbxOTifvIGgywm6gg-1; Thu, 08 Jul 2021 12:58:56 -0400 X-MC-Unique: uWoQXdbxOTifvIGgywm6gg-1 Received: by mail-ed1-f69.google.com with SMTP id m15-20020a056402430fb0290399da445c17so3679394edc.8 for ; Thu, 08 Jul 2021 09:58:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1+MxxEIgHppIPoGs9NgPZPuRjgmYFQ760KzTDD/t7B8=; b=HqCC/SEsFyFrk0RUNk01itnxa7QCbvAPybXdY0op48w03V1yZjznTFd2Y5/b4YKi/o HWyjxtLsLzxl/HJyJdZFTFnj6HBDEkiISJQ4Cgwv+iusLTjcF+663jfygvmehS9m+lcq pJH6hEwRacyYolfYKn0bjstBsvLqW4pcJkHxMcOjOjwUQTqOyQSKP+NDNYzbBL2iCACu YmemlIROeJNmR8s3QULPd6+rsuUTsj9xkmf/yTfHQMx9Jzx3gJbiwF+cy7ELM8SP6N3p umiP7IJYZaTh3fnSBaQ5641XWHhqEmRFQe6hnZ09Biz9C6tA68QD4FRACc8r4l+/V4tW 3TyQ== X-Gm-Message-State: AOAM533YteQZ9GvYanrN7Eqr1XrMGxsDtwg0UMuMSJXrHjLa1rGvMj3d i6ulc1jPLHyMpKx3uFcVSe7RtOV6seBJC0bvx0XKWn4OZ97mQ+ga8p9S1IRyTLBiWC8V0iZgcC5 yYwfc06Uh7zSg X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr40673377edu.352.1625763535370; Thu, 08 Jul 2021 09:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwskCkYwrqK5gDNs5Pk01sWgeZ01rPE8fbcAvoaGolRa9Pk5OAwoAWpbIh28BrbHtDOfUOY/w== X-Received: by 2002:a05:6402:1057:: with SMTP id e23mr40673368edu.352.1625763535253; Thu, 08 Jul 2021 09:58:55 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u26sm1170302ejx.8.2021.07.08.09.58.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Jul 2021 09:58:54 -0700 (PDT) Subject: Re: [PATCH next] kvm: debugfs: fix memory leak in kvm_create_vm_debugfs To: Jing Zhang , Pavel Skripkin Cc: KVM , linux-kernel@vger.kernel.org References: <20210701195500.27097-1-paskripkin@gmail.com> From: Paolo Bonzini Message-ID: <0b028e3d-d363-05cd-3dc3-8ccc5704ae1c@redhat.com> Date: Thu, 8 Jul 2021 18:58:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 01/07/21 23:24, Jing Zhang wrote: > In commit bc9e9e672df9 ("KVM: debugfs: Reuse binary stats descriptors") > loop for filling debugfs_stat_data was copy-pasted 2 times, but > in the second loop pointers are saved over pointers allocated > in the first loop. It causes memory leak. Fix it. > > Fixes: bc9e9e672df9 ("KVM: debugfs: Reuse binary stats descriptors") > Signed-off-by: Pavel Skripkin > --- Queued, thanks. Paolo