From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 9EFEA1DBB for ; Mon, 30 Apr 2018 16:44:37 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id o4-v6so8289701wrm.0 for ; Mon, 30 Apr 2018 07:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jC/MseKLU7ySlT4NYj9UjnS8mVr8CW7vm6qO2Q3yGtM=; b=s8SPo536LslYC1QuZdfQmo4BsPBdyT+DcIlQ6+4tG0sUeaa3mWaCbNqjHCfQC4QGsU he/4USapKjFmS9UD3pFHahk5ErNGQ9DokthyWfcWBblPiOGL3qTHGWmuYvKIkgdBVKMm moItmV0xsAhvdXQKk6XUqyK18Y+S8K3die37xVYyatkvZcib5eCwa4SBpSQZk3WHs3uf 3OuyFA6JLP6HqU2agg5dNp7cwodtU/ad9/LMCtNR/O6PMITRPqARgOKVM0E2ZWO6uLkY gC/gab9aCMsmVB/7dA4SasZpBWYEB3qmRBhCsIVPDwvYl1bBonVHXJsx01Qb/5U8+dhF e+KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jC/MseKLU7ySlT4NYj9UjnS8mVr8CW7vm6qO2Q3yGtM=; b=Tarv9U72+8/cnfwHSzLegJfLawSZ397XoO9nL3uyefOVoGzheKLXut2ZJqTSMWCZSw S/RB4JFtsoqJd6VYhmReBstOHrC/Iuudno76XzQkgq80vH3d7qaZLjPR/NfS/kgMdxQW SPVKj5Mh2BBFu8uzKtq5aswmNZvlskjfBRZz/Mn7FiQeAhra+eFiyuvPg1UCwW4KacEx Cchqd5GqPU6Q41tT6l+ES1GpxZxEj8lOBUTeuBFPT5ydn4G/0XiupYMWN6MvRoyVJ4Wq X6QJciiA9rk/DvVnoXGlbE1aLHWCabr4/t66seNW7Wwk7oQ8CiN2xQEC8T2j/tWFJnK3 4kRA== X-Gm-Message-State: ALQs6tBTaZ4g4v87y+8wZp7O4Cop8yEF5AhEtxKMmc/DPQW1mksiGCWI iW0vWOnY0yKuNyILwTvh6B8= X-Google-Smtp-Source: AB8JxZqCDiXTAJH9VlEXfYFtwD0xsd6E04psnMmMkkf3cXIuU3V8YrYiIDFoq6jKwrlqpX5vUzkOIw== X-Received: by 2002:adf:b2f4:: with SMTP id g107-v6mr9285491wrd.205.1525099477386; Mon, 30 Apr 2018 07:44:37 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v18-v6sm7312629wrf.76.2018.04.30.07.44.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:44:36 -0700 (PDT) From: luca.boccassi@gmail.com To: Andrew Rybchenko Cc: Olivier Matz , dpdk stable Date: Mon, 30 Apr 2018 15:41:38 +0100 Message-Id: <20180430144223.18657-83-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'mempool: fix leak when no objects are populated' has been queued to stable release 18.02.2 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: , X-List-Received-Date: Mon, 30 Apr 2018 14:44:37 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From a9640338bdc7ef5fc85d445d0b99b562006beb6b Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Mon, 16 Apr 2018 14:24:30 +0100 Subject: [PATCH] mempool: fix leak when no objects are populated [ upstream commit 25e6755056eaba45921b898b9986af68277ac6ac ] Fixes: 84121f197187 ("mempool: store memory chunks in a list") Suggested-by: Olivier Matz Signed-off-by: Andrew Rybchenko Acked-by: Olivier Matz --- lib/librte_mempool/rte_mempool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 54f7f4ba4..80bf941c9 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -408,12 +408,18 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, } /* not enough room to store one object */ - if (i == 0) - return -EINVAL; + if (i == 0) { + ret = -EINVAL; + goto fail; + } STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); mp->nb_mem_chunks++; return i; + +fail: + rte_free(memhdr); + return ret; } int -- 2.14.2