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 96D6BA0519 for ; Fri, 3 Jul 2020 09:23:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A5281D991; Fri, 3 Jul 2020 09:23:18 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id D25F81D991 for ; Fri, 3 Jul 2020 09:23:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593760996; 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=V94JvaO3u77+B11NZeyIBiVj1LPWOTlGpLcCYnn7CMgKzHTijlzH714+rLURq9Q2pL3Jus 31yrQxHhDgOQtWSf7QbA22UAxfceFmZ+pdoiQjE9zrko19YL8aQxr5MPXblJOCtR7Dq6Rw /6Z/H6GZ7Zwh4iNqMRvXRGlHT1QBvg8= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-460-ydnJ7tIlOBSoUxmQJPdYWw-1; Fri, 03 Jul 2020 03:23:14 -0400 X-MC-Unique: ydnJ7tIlOBSoUxmQJPdYWw-1 Received: by mail-vs1-f71.google.com with SMTP id k126so7258608vsk.15 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=k+vKUa9IEYSscI/UIDc+GlrqVTP56Ybh9HdqFxTdKe7L8F/VUBSisI0q359Z7NXJo5 LizRGj/F30mvaCE7UMoEmokLj0Ox6gquqSrf7/1uNF6RHrLoARgWdBDkQM0Mq0F7Qu+Y Vv/XqdR/7NND4NE2rhLj/2svH8UjBHKlSLKqIOIwSA4RrHuZHhtV+/bZr4fZt/YXLyyx /zvM60eVJAvCTtNNs3UuuwYvhCaMSomy6NhVP73Jwbs/n1Yt2GURLauRMTp82FxOIkO6 3Ekuv30wK0ewZ72NPdzQSbBapnzkojk6pQMKdm3SPj5NVXeoQKi/1nD166VZup6gvmKU vAIA== X-Gm-Message-State: AOAM531dTmEGckYNvmgwmywMtQ+/iU7QedAXa1xaZPPNo1cLu2JBpPyR k5KfOvjuH5E41ok66w6Nb2MfJByx1/iWkoYyjsESA7PE/NpkdqZnpKOyE4hmTS4n18tRmOEAGma p9FLVu6EQyUNHCOOnKN+oCk0= X-Received: by 2002:a67:2ed6:: with SMTP id u205mr5655572vsu.198.1593760994190; 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-stable] [dpdk-dev] [PATCH v3 1/2] eal: fix memory leak when removing event_cb X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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