diff options
author | Cong Ding <dinggnu@gmail.com> | 2013-01-15 05:17:29 -0500 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-01-17 01:41:48 -0500 |
commit | a046b816a4587c7898772af7cc7e6798cc8b56dd (patch) | |
tree | 366740af748d0f62a18aa3b3486cc49e7a499f97 /arch/s390 | |
parent | 6b81b05e449e15abb60eaa4f62cdc7954f4d74f0 (diff) |
KVM: s390: kvm/sigp.c: fix memory leakage
the variable inti should be freed in the branch CPUSTAT_STOPPED.
Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kvm/sigp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 461e84179db1..1c48ab2845e0 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c | |||
@@ -137,8 +137,10 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action) | |||
137 | inti->type = KVM_S390_SIGP_STOP; | 137 | inti->type = KVM_S390_SIGP_STOP; |
138 | 138 | ||
139 | spin_lock_bh(&li->lock); | 139 | spin_lock_bh(&li->lock); |
140 | if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) | 140 | if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) { |
141 | kfree(inti); | ||
141 | goto out; | 142 | goto out; |
143 | } | ||
142 | list_add_tail(&inti->list, &li->list); | 144 | list_add_tail(&inti->list, &li->list); |
143 | atomic_set(&li->active, 1); | 145 | atomic_set(&li->active, 1); |
144 | atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags); | 146 | atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags); |