public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Wang Hai <wanghai38@huawei.com>,
	hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com,
	colin.king@canonical.com
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/test_unwind: fix possible memleak in test_unwind()
Date: Thu, 30 Jul 2020 09:35:15 +0200	[thread overview]
Message-ID: <247044acbf1dbae8e3b48c2dcc1457cd2e59cfef.camel@linux.ibm.com> (raw)
In-Reply-To: <20200730063602.31581-1-wanghai38@huawei.com>

On Thu, 2020-07-30 at 14:36 +0800, Wang Hai wrote:
> test_unwind() misses to call kfree(bt) in an error path.
> Add the missed function call to fix it.
> 
> Fixes: 0610154650f1 ("s390/test_unwind: print verbose unwinding
> results")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> ---
>  arch/s390/lib/test_unwind.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/s390/lib/test_unwind.c
> b/arch/s390/lib/test_unwind.c
> index 32b7a30b2485..b0b12b46bc57 100644
> --- a/arch/s390/lib/test_unwind.c
> +++ b/arch/s390/lib/test_unwind.c
> @@ -63,6 +63,7 @@ static noinline int test_unwind(struct task_struct
> *task, struct pt_regs *regs,
>  			break;
>  		if (state.reliable && !addr) {
>  			pr_err("unwind state reliable but addr is
> 0\n");
> +			kfree(bt);
>  			return -EINVAL;
>  		}
>  		sprint_symbol(sym, addr);

Looks good to me, thanks!

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>

  reply	other threads:[~2020-07-30  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  6:36 [PATCH] s390/test_unwind: fix possible memleak in test_unwind() Wang Hai
2020-07-30  7:35 ` Ilya Leoshkevich [this message]
2020-07-31 11:52   ` Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=247044acbf1dbae8e3b48c2dcc1457cd2e59cfef.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=colin.king@canonical.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=wanghai38@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox