Patchwork [scsi-next] vhost-scsi: fix cut-and-paste typo

login
register
mail settings
Submitter Paolo Bonzini
Date May 31, 2013, 11:15 a.m.
Message ID <1369998956-5366-1-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/247926/
State New
Headers show

Comments

Paolo Bonzini - May 31, 2013, 11:15 a.m.
The copied code comes from vhost_scsi_start.  Spotted by Coverity.

Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/scsi/vhost-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Markus Armbruster - June 3, 2013, 12:27 p.m.
Paolo Bonzini <pbonzini@redhat.com> writes:

> The copied code comes from vhost_scsi_start.  Spotted by Coverity.
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Same as Stefan's [PATCH 1/3] vhost-scsi: fix k->set_guest_notifiers()
NULL dereference
Paolo Bonzini - June 3, 2013, 12:56 p.m.
Il 03/06/2013 14:27, Markus Armbruster ha scritto:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
>> The copied code comes from vhost_scsi_start.  Spotted by Coverity.
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> 
> Same as Stefan's [PATCH 1/3] vhost-scsi: fix k->set_guest_notifiers()
> NULL dereference

Yes, but his commit message makes more fun of the guy who wrote the
code.  Since I deserve it, I'm applying his version.

Paolo

Patch

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index d7a1c33..785e93f 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -123,7 +123,7 @@  static void vhost_scsi_stop(VHostSCSI *s)
     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
     int ret = 0;
 
-    if (!k->set_guest_notifiers) {
+    if (k->set_guest_notifiers) {
         ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false);
         if (ret < 0) {
                 error_report("vhost guest notifier cleanup failed: %d\n", ret);