diff mbox

cryptodev: fix asserting single queue

Message ID 20170322123655.32085-1-pasic@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Halil Pasic March 22, 2017, 12:36 p.m. UTC
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.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
---
 backends/cryptodev-builtin.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Halil Pasic March 22, 2017, 2:56 p.m. UTC | #1
On 03/22/2017 01:36 PM, Halil Pasic wrote:
> 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.
> 
> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>

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

Reported-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
> ---
>  backends/cryptodev-builtin.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
> index 82a068e..137c7a6 100644
> --- a/backends/cryptodev-builtin.c
> +++ b/backends/cryptodev-builtin.c
> @@ -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) {
>
Eric Blake March 22, 2017, 3:33 p.m. UTC | #2
On 03/22/2017 09:56 AM, Halil Pasic wrote:
> 
> 
> On 03/22/2017 01:36 PM, Halil Pasic wrote:
>> 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.
>>
>> Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> 
> Sorry guys, I forgot to give credit to the reporter.
> 
> Reported-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>

Reviewed-by: Eric Blake <eblake@redhat.com>

>> ---
>>  backends/cryptodev-builtin.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
>> index 82a068e..137c7a6 100644
>> --- a/backends/cryptodev-builtin.c
>> +++ b/backends/cryptodev-builtin.c
>> @@ -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) {
>>
> 
> 
>
Gonglei (Arei) March 23, 2017, 1:09 a.m. UTC | #3
> 
> 
> On 03/22/2017 01:36 PM, Halil Pasic wrote:
> > 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.
> >
> > Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
> 
> Sorry guys, I forgot to give credit to the reporter.
> 
> Reported-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>

Applied, thanks!


> > ---
> >  backends/cryptodev-builtin.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
> > index 82a068e..137c7a6 100644
> > --- a/backends/cryptodev-builtin.c
> > +++ b/backends/cryptodev-builtin.c
> > @@ -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) {
> >
diff mbox

Patch

diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c
index 82a068e..137c7a6 100644
--- a/backends/cryptodev-builtin.c
+++ b/backends/cryptodev-builtin.c
@@ -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) {