KVM: s390: fix handling of write errors in the tpi handler
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Wed, 4 Feb 2015 14:53:42 +0000 (15:53 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 6 Mar 2015 12:40:33 +0000 (13:40 +0100)
commit261520dcfcba93ca5dfe671b88ffab038cd940c8
treeb4c67ed384402a61f05c69a7ef6ae4ee20228162
parentb75f4c9afac2604feb971441116c07a24ecca1ec
KVM: s390: fix handling of write errors in the tpi handler

If the I/O interrupt could not be written to the guest provided
area (e.g. access exception), a program exception was injected into the
guest but "inti" wasn't freed, therefore resulting in a memory leak.

In addition, the I/O interrupt wasn't reinjected. Therefore the dequeued
interrupt is lost.

This patch fixes the problem while cleaning up the function and making the
cc and rc logic easier to handle.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/priv.c