* [dpdk-dev] [PATCH] crypto/virtio: fix memory leak
@ 2018-07-19 9:05 Pablo de Lara
2018-07-23 7:44 ` Zhoujian (jay)
0 siblings, 1 reply; 3+ messages in thread
From: Pablo de Lara @ 2018-07-19 9:05 UTC (permalink / raw)
To: jianjay.zhou; +Cc: dev, Pablo de Lara, stable
Put session private data back to mempool when clearing
a crypto session, which is expected to be done in the PMD.
Fixes: b7fa78c7d3b0 ("crypto/virtio: support session related ops")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
drivers/crypto/virtio/virtio_cryptodev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c
index cc7a0b101..568b5a406 100644
--- a/drivers/crypto/virtio/virtio_cryptodev.c
+++ b/drivers/crypto/virtio/virtio_cryptodev.c
@@ -1076,7 +1076,10 @@ virtio_crypto_sym_clear_session(
VIRTIO_CRYPTO_SESSION_LOG_INFO("Close session %"PRIu64" successfully ",
session->session_id);
- memset(sess, 0, sizeof(struct virtio_crypto_session));
+ memset(session, 0, sizeof(struct virtio_crypto_session));
+ struct rte_mempool *sess_mp = rte_mempool_from_obj(session);
+ set_sym_session_private_data(sess, cryptodev_virtio_driver_id, NULL);
+ rte_mempool_put(sess_mp, session);
rte_free(malloc_virt_addr);
}
--
2.14.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/virtio: fix memory leak
2018-07-19 9:05 [dpdk-dev] [PATCH] crypto/virtio: fix memory leak Pablo de Lara
@ 2018-07-23 7:44 ` Zhoujian (jay)
2018-07-23 9:40 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 3+ messages in thread
From: Zhoujian (jay) @ 2018-07-23 7:44 UTC (permalink / raw)
To: Pablo de Lara; +Cc: dev, stable, wangxin (U)
> -----Original Message-----
> From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com]
> Sent: Thursday, July 19, 2018 5:06 PM
> To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> Cc: dev@dpdk.org; Pablo de Lara <pablo.de.lara.guarch@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] crypto/virtio: fix memory leak
>
> Put session private data back to mempool when clearing a crypto session,
> which is expected to be done in the PMD.
>
> Fixes: b7fa78c7d3b0 ("crypto/virtio: support session related ops")
> Cc: stable@dpdk.org
>
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Jay Zhou <jianjay.zhou@huawei.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] crypto/virtio: fix memory leak
2018-07-23 7:44 ` Zhoujian (jay)
@ 2018-07-23 9:40 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 3+ messages in thread
From: De Lara Guarch, Pablo @ 2018-07-23 9:40 UTC (permalink / raw)
To: Zhoujian (jay); +Cc: dev, stable, wangxin (U)
> -----Original Message-----
> From: Zhoujian (jay) [mailto:jianjay.zhou@huawei.com]
> Sent: Monday, July 23, 2018 8:45 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; wangxin (U)
> <wangxinxin.wang@huawei.com>
> Subject: RE: [PATCH] crypto/virtio: fix memory leak
>
> > -----Original Message-----
> > From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com]
> > Sent: Thursday, July 19, 2018 5:06 PM
> > To: Zhoujian (jay) <jianjay.zhou@huawei.com>
> > Cc: dev@dpdk.org; Pablo de Lara <pablo.de.lara.guarch@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH] crypto/virtio: fix memory leak
> >
> > Put session private data back to mempool when clearing a crypto
> > session, which is expected to be done in the PMD.
> >
> > Fixes: b7fa78c7d3b0 ("crypto/virtio: support session related ops")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
>
> Reviewed-by: Jay Zhou <jianjay.zhou@huawei.com>
Applied to dpdk-next-crypto.
Pablo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-23 9:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19 9:05 [dpdk-dev] [PATCH] crypto/virtio: fix memory leak Pablo de Lara
2018-07-23 7:44 ` Zhoujian (jay)
2018-07-23 9:40 ` De Lara Guarch, Pablo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).