From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED050A0519; Fri, 3 Jul 2020 09:23:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B939E1DA08; Fri, 3 Jul 2020 09:23:20 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id DCA881DA08 for ; Fri, 3 Jul 2020 09:23:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593760998; 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: in-reply-to:in-reply-to:references:references; bh=j272M24MFExe8Yj9qSN0P26txdbj+uqxlWnQNS1Pyzs=; b=JWHqQM7XvDnmd9QHWzO9dr1csJ1wPFHdBkrtXAIUSO/bNvDgOC8VETGmdGkGagXxSlTKf9 alGZZWy7oXtDZeoCnkMUPVw9t+aJktlLbDKAgwe2qzeM+a1sgLttez6JVlyLj4i8BDWKwd gkm3SmA4xApNRfutQCI3CKaG+PXcYUs= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-ng-ktbgmOpKcNxpYqk1Xvw-1; Fri, 03 Jul 2020 03:23:14 -0400 X-MC-Unique: ng-ktbgmOpKcNxpYqk1Xvw-1 Received: by mail-ua1-f72.google.com with SMTP id 14so2609743uak.5 for ; Fri, 03 Jul 2020 00:23:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=j272M24MFExe8Yj9qSN0P26txdbj+uqxlWnQNS1Pyzs=; b=I1XxF1Rc5yseDd1ltLo9p47bBzHHk0FpAPct6A95IRieLBh1+GUFFG8onb8HFrAE3r U1mlYLM62VbLo2AAC7Hc7ceFj7HWZKDysh4B5b7/FGA9Yi+uoZfKD0Q2Lt2noiw0uUo8 P4QvPxrIrchQPv2/wGd30oOc/yLGblthEQ5MILFeKgEGLuZiOrzCwyAAM4mnTxcDmJsL rGH7kxxdXQc32mhJLpM8fswSLdsxGW4xSt96UFr0nHXkntPvQ+r/gC2uHKQ+IJhkkvIs RidLgengzPvMauacwcnp88/9bhw2Rf6zMGIW/vqzsEoupgnTsJwTKHJItjVuEgSs6p2C fmDQ== X-Gm-Message-State: AOAM531Xz8qwxcmtsvrkAEF8rM1tUSbXfunOs9O9gDfiXGFfYsEFyBEh 0CXv8PzSu/ZPumITM42w7i+ufjrY6fwZELe/q0vjE1wCeiiqZSdFTVeEJSleBApsEK+kCZz1+lj guUwu0OiKgJCaPs5TIV8= X-Received: by 2002:a67:2ed6:: with SMTP id u205mr5655568vsu.198.1593760994188; Fri, 03 Jul 2020 00:23:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNyJh1AACqpLeI5KXsO3bo39jzz9dOnandxXnllSMvmEtaOt+4CCFRv9nylFlZKmsOxmqcHCJIHp7sqO6a0Fc= X-Received: by 2002:a67:2ed6:: with SMTP id u205mr5655558vsu.198.1593760993953; Fri, 03 Jul 2020 00:23:13 -0700 (PDT) MIME-Version: 1.0 References: <1593690428-12708-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: <1593690428-12708-1-git-send-email-wangyunjian@huawei.com> From: David Marchand Date: Fri, 3 Jul 2020 09:23:02 +0200 Message-ID: To: wangyunjian Cc: dev , Jeff Guo , "Lilijun (Jerry)" , xudingke , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 1/2] eal: fix memory leak when removing event_cb X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jul 2, 2020 at 1:47 PM wangyunjian wrote: > > From: Yunjian Wang > > The event_cb->dev_name is not freed when freeing event_cb, > and this causes a memory leak. > > Fixes: a753e53d517b ("eal: add device event monitor framework") > Cc: stable@dpdk.org > > Signed-off-by: Yunjian Wang > --- > lib/librte_eal/common/eal_common_dev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c > index 9e4f09d..4cfdb80 100644 > --- a/lib/librte_eal/common/eal_common_dev.c > +++ b/lib/librte_eal/common/eal_common_dev.c > @@ -526,6 +526,8 @@ static int cmp_dev_name(const struct rte_device *dev, const void *_name) > */ > if (event_cb->active == 0) { > TAILQ_REMOVE(&dev_event_cbs, event_cb, next); > + if (event_cb->dev_name) > + free(event_cb->dev_name); No need for the check, free handles a NULL pointer just fine. Please, could you update your series/patches status in patchwork? I am a bit lost at what is superseded or not. Thanks. -- David Marchand