DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marko Kovacevic <marko.kovacevic@intel.com>
To: dev@dpdk.org
Cc: john.mcnamara@intel.com, xinfengx.zhao@intel.com,
	akhil.goyal@nxp.com, Marko Kovacevic <marko.kovacevic@intel.com>,
	roy.fan.zhang@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 3/3] cryptodev: fix uninitialized session clear
Date: Mon, 15 Apr 2019 16:04:49 +0100	[thread overview]
Message-ID: <20190415150449.44799-3-marko.kovacevic@intel.com> (raw)
Message-ID: <20190415150449.D8TU-CEWlz-Nq02NJnr3Cdubc8s3h7JGvmNQ6Q8dvPI@z> (raw)
In-Reply-To: <20190415150449.44799-1-marko.kovacevic@intel.com>

added check to see if a session for a device
has been initialised if it has return 0.

Fixes: 5d6c73dd5938 ("cryptodev: add reference count to session private data")
Cc: roy.fan.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 2675e1ef7..00c2cf432 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1386,6 +1386,8 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id,
 		return -EINVAL;
 
 	driver_id = dev->driver_id;
+	if (sess->sess_data[driver_id].refcnt == 0)
+		return 0;
 	if (--sess->sess_data[driver_id].refcnt != 0)
 		return -EBUSY;
 
-- 
2.13.6


  parent reply	other threads:[~2019-04-15 15:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 14:16 [dpdk-dev] [PATCH v1 1/3] examples/fips: fix hmac test failure Marko Kovacevic
2019-04-11 14:16 ` Marko Kovacevic
2019-04-11 14:16 ` [dpdk-dev] [PATCH v1 2/3] examples/fips_validation: fix cmac " Marko Kovacevic
2019-04-11 14:16   ` Marko Kovacevic
2019-04-11 14:16 ` [dpdk-dev] [PATCH v1 3/3] cryptodev: fix uninitialized session clear Marko Kovacevic
2019-04-11 14:16   ` Marko Kovacevic
2019-04-15 15:04 ` [dpdk-dev] [PATCH v2 1/3] examples/fips: fix hmac test failure Marko Kovacevic
2019-04-15 15:04   ` Marko Kovacevic
2019-04-15 15:04   ` [dpdk-dev] [PATCH v2 2/3] examples/fips_validation: fix cmac " Marko Kovacevic
2019-04-15 15:04     ` Marko Kovacevic
2019-04-15 15:04   ` Marko Kovacevic [this message]
2019-04-15 15:04     ` [dpdk-dev] [PATCH v2 3/3] cryptodev: fix uninitialized session clear Marko Kovacevic
2019-04-15 18:06     ` Trahe, Fiona
2019-04-15 18:06       ` Trahe, Fiona

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190415150449.44799-3-marko.kovacevic@intel.com \
    --to=marko.kovacevic@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=john.mcnamara@intel.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xinfengx.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).