All of lore.kernel.org
 help / color / mirror / Atom feed
From: "HATAYAMA, Daisuke" <d.hatayama@jp.fujitsu.com>
To: Chao Fan <cfan@redhat.com>, kexec@lists.infradead.org
Subject: Re: [PATCH] makedumpfile: remove the double free of sph
Date: Wed, 26 Aug 2015 12:59:39 +0900	[thread overview]
Message-ID: <55DD39AB.9030505@jp.fujitsu.com> (raw)
In-Reply-To: <1440559354-8252-1-git-send-email-cfan@redhat.com>



On 2015/08/26 12:22, Chao Fan wrote:
> sph will be freed twice when it meet below conditions:
>
>              sph->signature1 != SADUMP_SIGNATURE1 ||
>              sph->signature2 != SADUMP_SIGNATURE2
>
> Then it will be freed once and goto error: to free again. So remove the
> 1st free.
>
> Signed-off-by: Chao Fan <cfan@redhat.com>
> ---
>   sadump_info.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/sadump_info.c b/sadump_info.c
> index e8154f4..1474fb2 100644
> --- a/sadump_info.c
> +++ b/sadump_info.c
> @@ -695,7 +695,6 @@ read_sadump_header_diskset(int diskid, struct sadump_diskset_info *sdi)
>   	if (sph->signature1 != SADUMP_SIGNATURE1 ||
>   	    sph->signature2 != SADUMP_SIGNATURE2) {
>   		DEBUG_MSG("sadump: does not have partition header\n");
> -		free(sph);
>   		goto error;
>   	}
>
>

Thanks! It looks good to me.

Acked-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>

-- 
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-08-26  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  3:22 [PATCH] makedumpfile: remove the double free of sph Chao Fan
2015-08-26  3:59 ` HATAYAMA, Daisuke [this message]
2015-08-26  4:23   ` Atsushi Kumagai

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=55DD39AB.9030505@jp.fujitsu.com \
    --to=d.hatayama@jp.fujitsu.com \
    --cc=cfan@redhat.com \
    --cc=kexec@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.