Skip to contentSkip to conversation

cryptodev: fix asserting single queue

PATCH Applied Halil Pasic 3 participants 4 messages Mar 22, 2017 – Mar 23, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cryptodev: fix asserting single queue

We already check for queues == 1 in cryptodev_builtin_init and when that is not true raise an error. But before that error is reported the assertion in cryptodev_builtin_cleanup kicks in (because object is being finalized and freed).

Let's remove assert(queues == 1) form cryptodev_builtin_cleanup as it does only harm and no good.

---
 backends/cryptodev-builtin.c | 2 --
 1 file changed, 2 deletions(-)
backends/cryptodev-builtin.c +0 -2
index 82a068e..137c7a6 100644
@@ -359,8 +359,6 @@ static void cryptodev_builtin_cleanup(
         }
     }
 
-    assert(queues == 1);
-
     for (i = 0; i < queues; i++) {
         cc = backend->conf.peers.ccs[i];
         if (cc) {
Signature · 1 line
2.8.4
#1 lore raw
Quoted 9 lines · Halil Pasic

We already check for queues == 1 in cryptodev_builtin_init and when that is not true raise an error. But before that error is reported the assertion in cryptodev_builtin_cleanup kicks in (because object is being finalized and freed).

Let's remove assert(queues == 1) form cryptodev_builtin_cleanup as it does only harm and no good.

Sorry guys, I forgot to give credit to the reporter.

Quoted 18 lines
---
 backends/cryptodev-builtin.c | 2 --
 1 file changed, 2 deletions(-)
backends/cryptodev-builtin.c +0 -2
index 82a068e..137c7a6 100644
@@ -359,8 +359,6 @@ static void cryptodev_builtin_cleanup(
         }
     }
 
-    assert(queues == 1);
-
     for (i = 0; i < queues; i++) {
         cc = backend->conf.peers.ccs[i];
         if (cc) {
Reviewed-by
#2 lore raw
Quoted 8 lines · Halil Pasic
Quoted 5 lines · Halil Pasic

We already check for queues == 1 in cryptodev_builtin_init and when that is not true raise an error. But before that error is reported the assertion in cryptodev_builtin_cleanup kicks in (because object is being finalized and freed).

Quoted 8 lines
Quoted 4 lines

Let's remove assert(queues == 1) form cryptodev_builtin_cleanup as it does only harm and no good.

Sorry guys, I forgot to give credit to the reporter.

Quoted 21 lines
Quoted 18 lines
---
 backends/cryptodev-builtin.c | 2 --
 1 file changed, 2 deletions(-)
backends/cryptodev-builtin.c +0 -2
index 82a068e..137c7a6 100644
@@ -359,8 +359,6 @@ static void cryptodev_builtin_cleanup(
         }
     }
 
-    assert(queues == 1);
-
     for (i = 0; i < queues; i++) {
         cc = backend->conf.peers.ccs[i];
         if (cc) {
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#3 lore raw
In reply to Halil Pasic
Quoted 8 lines · Halil Pasic
Quoted 5 lines

We already check for queues == 1 in cryptodev_builtin_init and when that is not true raise an error. But before that error is reported the assertion in cryptodev_builtin_cleanup kicks in (because object is being finalized and freed).

Quoted 8 lines
Quoted 4 lines

Let's remove assert(queues == 1) form cryptodev_builtin_cleanup as it does only harm and no good.

Sorry guys, I forgot to give credit to the reporter.

Applied, thanks!

Quoted 18 lines
Quoted 18 lines
---
 backends/cryptodev-builtin.c | 2 --
 1 file changed, 2 deletions(-)
backends/cryptodev-builtin.c +0 -2
index 82a068e..137c7a6 100644
@@ -359,8 +359,6 @@ static void cryptodev_builtin_cleanup(
         }
     }
 
-    assert(queues == 1);
-
     for (i = 0; i < queues; i++) {
         cc = backend->conf.peers.ccs[i];
         if (cc) {