OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:03:38 +0000 (22:03 +0200)
commitbcdd54ffac32205938fa2cdd656604973275214b
tree3d9c0eb65e5d53da305a2fd9a037d77bcdca6e84
parent9297ed24421df19f5c5085d65ee2575a63524447
KVM: s390: fix handling of write errors in the tpi handler

commit 261520dcfcba93ca5dfe671b88ffab038cd940c8 upstream.

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>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kvm/priv.c