qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cryptodev: fix asserting single queue
@ 2017-03-22 12:36 Halil Pasic
  2017-03-22 14:56 ` Halil Pasic
  0 siblings, 1 reply; 4+ messages in thread
From: Halil Pasic @ 2017-03-22 12:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gonglei, 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.

Signed-off-by: Halil Pasic <pasic@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) {
-- 
2.8.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] cryptodev: fix asserting single queue
  2017-03-22 12:36 [Qemu-devel] [PATCH] cryptodev: fix asserting single queue Halil Pasic
@ 2017-03-22 14:56 ` Halil Pasic
  2017-03-22 15:33   ` Eric Blake
  2017-03-23  1:09   ` Gonglei (Arei)
  0 siblings, 2 replies; 4+ messages in thread
From: Halil Pasic @ 2017-03-22 14:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gonglei



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) {
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] cryptodev: fix asserting single queue
  2017-03-22 14:56 ` Halil Pasic
@ 2017-03-22 15:33   ` Eric Blake
  2017-03-23  1:09   ` Gonglei (Arei)
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2017-03-22 15:33 UTC (permalink / raw)
  To: Halil Pasic, qemu-devel; +Cc: Gonglei

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

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) {
>>
> 
> 
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] cryptodev: fix asserting single queue
  2017-03-22 14:56 ` Halil Pasic
  2017-03-22 15:33   ` Eric Blake
@ 2017-03-23  1:09   ` Gonglei (Arei)
  1 sibling, 0 replies; 4+ messages in thread
From: Gonglei (Arei) @ 2017-03-23  1:09 UTC (permalink / raw)
  To: Halil Pasic, qemu-devel@nongnu.org

> 
> 
> 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) {
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-23  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22 12:36 [Qemu-devel] [PATCH] cryptodev: fix asserting single queue Halil Pasic
2017-03-22 14:56 ` Halil Pasic
2017-03-22 15:33   ` Eric Blake
2017-03-23  1:09   ` Gonglei (Arei)

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).