Skip to content

Commit

Permalink
KVM: s390: kvm/sigp.c: fix memory leakage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cong Ding authored and Gleb Natapov committed Jan 17, 2013
1 parent 6b81b05 commit a046b81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/s390/kvm/sigp.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
inti->type = KVM_S390_SIGP_STOP;

spin_lock_bh(&li->lock);
if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED))
if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED)) {
kfree(inti);
goto out;
}
list_add_tail(&inti->list, &li->list);
atomic_set(&li->active, 1);
atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags);
Expand Down

0 comments on commit a046b81

Please sign in to comment.