Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a046b816 authored by Cong Ding's avatar Cong Ding Committed by Gleb Natapov
Browse files

KVM: s390: kvm/sigp.c: fix memory leakage



the variable inti should be freed in the branch CPUSTAT_STOPPED.

Signed-off-by: default avatarCong Ding <dinggnu@gmail.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
parent 6b81b05e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);