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 265911B885 for ; Tue, 15 May 2018 15:47:49 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id 94-v6so221518wrf.5 for ; Tue, 15 May 2018 06:47:49 -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=00UP3kun/06hhIaM9BJ5JHQ/hI5ziobJiBmjTOHlFgM=; b=HiXWLFjhjEhBevdmr06EGVZ7p0kd/5MDNHpi3ptLvvEm0Q4mOUhG07Ecb+CyTJAAWX /lV8xigdkSAhHQZkw9Mv39NsxkG/wnzo0vfWiIRRZ66s0gNR5GPH1/X4p75lI1h4XN93 0gFYlTcsdLH4ifA7lzm5F2Wt16y+SlmR7DKqYfIJ7Onf8aOiqrhSGGdT76HiQ+Jwvfs5 9P988YsLLUH574RorAjwP/LKZLKUVkU4f6ELe+6frmGpms88mmGayArsY28PhNaPfMD3 5AP5uW9qjBMhjKTYjNjIX8Blz0DNK1g4n3tT5R7sueYGrF9B8ZZEMEWHSbFzKfo/WZx5 Tkpw== 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=00UP3kun/06hhIaM9BJ5JHQ/hI5ziobJiBmjTOHlFgM=; b=AgYtiMnyzA8PW4gEL1EBpCvA0+HZ3d+C8mVZ6WDFsMU1CU0jLp01v8GQvJ5qv0Yidn KQ7NTIfEA8jmAH0ssInRsR5xR9DnlXpqXoab4ORMhB2rS7RJNAT9OMAyU6glR+j1kREC QFdo9uoCP4gsoqlvi7M6q87VyL1f6B3m6z09+qFXVQRB66D/ithIrYWV5IURJvOBGWW3 BG/GeFoiFN50dMXNNy1jR5RQ93Rnpx+PLVDOwNo/Kn5ODd70ZF7dSQwPk62WO5Z0exFQ 7n5nJWxjByuaqgUvzjRof4TMpGsEBgoXxaJhTXE1nASV1oeYHDaJCmOwEFiAOuPXQa19 ABbw== X-Gm-Message-State: ALKqPwdVGEE4rC2SPvGHSY79fPMqH0IY9AvA1oBiX0Je2ZJ53cgOL5+q 1/LpCVR7vrDvbVTWQXZdZ1FazkES X-Google-Smtp-Source: AB8JxZqkaeW/047g+PUUKlYY6ojC5gtuIII9+S6s3KWoUTbW+ja3x2gjjb5CElpTDvurUUGnLBgDCA== X-Received: by 2002:adf:b067:: with SMTP id g36-v6mr10533080wra.128.1526392068834; Tue, 15 May 2018 06:47:48 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id i30-v6sm149715wra.38.2018.05.15.06.47.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 06:47:47 -0700 (PDT) From: luca.boccassi@gmail.com To: Pablo de Lara Cc: Fan Zhang , dpdk stable Date: Tue, 15 May 2018 14:46:16 +0100 Message-Id: <20180515134731.9337-5-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515134731.9337-1-luca.boccassi@gmail.com> References: <20180503110612.12146-2-luca.boccassi@gmail.com> <20180515134731.9337-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'crypto/scheduler: fix memory leak' 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: Tue, 15 May 2018 13:47:49 -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/16/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 9e0d2079382dc33037492c460292c595fcb07f40 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 26 Apr 2018 16:09:50 +0100 Subject: [PATCH] crypto/scheduler: fix memory leak [ upstream commit 7b2491a62dcc4da2ad5afca2dbba458588126c23 ] If private context creation fails, the memory allocated for it and for some of the rings created was being leaked. In case of failure, it must be freed. Fixes: 4c07e0552f0a ("crypto/scheduler: add multicore scheduling mode") Signed-off-by: Pablo de Lara Acked-by: Fan Zhang --- drivers/crypto/scheduler/scheduler_multicore.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index 15a57c3db..644426e93 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -352,20 +352,29 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev) rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); if (!mc_ctx->sched_enq_ring[i]) { CS_LOG_ERR("Cannot create ring for worker %u", i); - return -1; + goto exit; } snprintf(r_name, sizeof(r_name), MC_SCHED_DEQ_RING_NAME_PREFIX "%u", i); mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name, PER_SLAVE_BUFF_SIZE, rte_socket_id(), RING_F_SC_DEQ | RING_F_SP_ENQ); if (!mc_ctx->sched_deq_ring[i]) { CS_LOG_ERR("Cannot create ring for worker %u", i); - return -1; + goto exit; } } sched_ctx->private_ctx = (void *)mc_ctx; return 0; + +exit: + for (i = 0; i < sched_ctx->nb_wc; i++) { + rte_ring_free(mc_ctx->sched_enq_ring[i]); + rte_ring_free(mc_ctx->sched_deq_ring[i]); + } + rte_free(mc_ctx); + + return -1; } struct rte_cryptodev_scheduler_ops scheduler_mc_ops = { -- 2.14.2