Skip to contentSkip to conversation

kvm:s390:Fix assumption that kvm_set_irq_routing is always run successfully

PATCH Applied Paolo Bonzini 2 participants 3 messages Aug 7, 2015 – Aug 10, 2015 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Paolo Bonzini

author maintainer
#1 lore raw
Quoted 18 lines · Nicholas Krause

This fixes the assumption that kvm_set_irq_routing is always run successfully by instead making it equal to the variable r which we use for returning in the function kvm_arch_vm_ioctl instead of making r equal to zero when calling this particular function and incorrectly making the caller of kvm_arch_vm_ioctl think the function has run successfully.

---
 arch/s390/kvm/kvm-s390.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/kvm/kvm-s390.c +0 -0
index f32f843..660860f 100644

arch/s390/kvm/kvm-s390.c long kvm_arch_vm_ioctl(struct file *filp, · line 885

Quoted 9 lines
arch/s390/kvm/kvm-s390.c +1 -2
@@ -879,8 +879,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
 		if (kvm->arch.use_irqchip) {
 			/* Set up dummy routing. */
 			memset(&routing, 0, sizeof(routing));
-			kvm_set_irq_routing(kvm, &routing, 0, 0);
-			r = 0;
+			r = kvm_set_irq_routing(kvm, &routing, 0, 0);
 		}
 		break;
 	}

Seems good.

Paolo

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer
#3 lore raw
Quoted 6 lines · nick
Quoted 3 lines

Seems good.

Paolo

If it makes it easier for you to trust my patches I can show at least 10 bug fixes for other subsystems to prove that I am trying to do this correctly.

That's up to those maintainers...

I definitely see some improvement in your patches, though I still haven't answered the submissions that in my opinion are a bit more problematic.

Paolo

#4 lore raw
In reply to a message not in the archive

Am 06.08.2015 um 19:05 schrieb Nicholas Krause:

Quoted 18 lines

This fixes the assumption that kvm_set_irq_routing is always run successfully by instead making it equal to the variable r which we use for returning in the function kvm_arch_vm_ioctl instead of making r equal to zero when calling this particular function and incorrectly making the caller of kvm_arch_vm_ioctl think the function has run successfully.

---
 arch/s390/kvm/kvm-s390.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/kvm/kvm-s390.c +0 -0
index f32f843..660860f 100644

arch/s390/kvm/kvm-s390.c long kvm_arch_vm_ioctl(struct file *filp, · line 885

Quoted 9 lines
arch/s390/kvm/kvm-s390.c +1 -2
@@ -879,8 +879,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
 		if (kvm->arch.use_irqchip) {
 			/* Set up dummy routing. */
 			memset(&routing, 0, sizeof(routing));
-			kvm_set_irq_routing(kvm, &routing, 0, 0);
-			r = 0;
+			r = kvm_set_irq_routing(kvm, &routing, 0, 0);
 		}
 		break;
 	}

Thanks, applied with changed prefix (KVM: s390:)