From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755976AbbHGHSb (ORCPT ); Fri, 7 Aug 2015 03:18:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50078 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755923AbbHGHS2 (ORCPT ); Fri, 7 Aug 2015 03:18:28 -0400 Subject: Re: [PATCH] kvm:s390:Fix assumption that kvm_set_irq_routing is always run successfully To: Nicholas Krause , gleb@kernel.org References: <1438880754-27149-1-git-send-email-xerofoify@gmail.com> Cc: borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, linux390@de.ibm.com, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org From: Paolo Bonzini Message-ID: <55C45BB7.6020502@redhat.com> Date: Fri, 7 Aug 2015 09:18:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1438880754-27149-1-git-send-email-xerofoify@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/08/2015 19:05, Nicholas Krause wrote: > 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. > > Signed-off-by: Nicholas Krause > --- > arch/s390/kvm/kvm-s390.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index f32f843..660860f 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -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