s390: kvm/sigp.c: fix memory leakage
PATCH 1/1 s390: kvm/sigp.c: fix memory leakage
the variable inti should be freed in the branch CPUSTAT_STOPPED.
Signed-off-by Cong Ding <[email protected]>
--- arch/s390/kvm/sigp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/s390/kvm/sigp.c +3 -1
@@ -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);
Signature · 1 line
1.7.9.5
Cornelia Huck
AppliedQuoted 13 lines · On Mon, 14 Jan 2013 22:39:54 +0100 Cong Ding <[email protected]> wrote:
the variable inti should be freed in the branch
CPUSTAT_STOPPED.Signed-off-by Cong Ding <[email protected]>--- arch/s390/kvm/sigp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/s390/kvm/sigp.c +0
-0@@ -137,8 +137,10 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action) inti->type =KVM_S390_SIGP_STOP ;
arch/s390/kvm/sigp.c static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action) · line 146
Quoted 10 lines
arch/s390/kvm/sigp.c +3
-1spin_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);
Thanks, applied.