All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <gqjiang@suse.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, shli@kernel.org
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] md-cluster: Fix a memleak in an error handling path
Date: Fri, 14 Apr 2017 06:23:56 +0000	[thread overview]
Message-ID: <58F06AFC.509@suse.com> (raw)
In-Reply-To: <20170414060803.12472-1-christophe.jaillet@wanadoo.fr>



On 04/14/2017 02:08 PM, Christophe JAILLET wrote:
> We know that 'bm_lockres' is NULL here, so 'lockres_free(bm_lockres)' is a
> no-op. According to resource handling in case of error a few lines below,
> it is likely that 'bitmap_free(bitmap)' was expected instead.
>
> Fixes: b98938d16a10 ("md-cluster: introduce cluster_check_sync_size")

Reviewed-by: Guoqing Jiang <gqjiang@suse.com>

Thanks,
Guoqing

>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/md/md-cluster.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
> index b21ef58819f6..7299ce2f08a8 100644
> --- a/drivers/md/md-cluster.c
> +++ b/drivers/md/md-cluster.c
> @@ -1127,7 +1127,7 @@ int cluster_check_sync_size(struct mddev *mddev)
>   		bm_lockres = lockres_init(mddev, str, NULL, 1);
>   		if (!bm_lockres) {
>   			pr_err("md-cluster: Cannot initialize %s\n", str);
> -			lockres_free(bm_lockres);
> +			bitmap_free(bitmap);
>   			return -1;
>   		}
>   		bm_lockres->flags |= DLM_LKF_NOQUEUE;


WARNING: multiple messages have this Message-ID (diff)
From: Guoqing Jiang <gqjiang@suse.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, shli@kernel.org
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] md-cluster: Fix a memleak in an error handling path
Date: Fri, 14 Apr 2017 14:23:56 +0800	[thread overview]
Message-ID: <58F06AFC.509@suse.com> (raw)
In-Reply-To: <20170414060803.12472-1-christophe.jaillet@wanadoo.fr>



On 04/14/2017 02:08 PM, Christophe JAILLET wrote:
> We know that 'bm_lockres' is NULL here, so 'lockres_free(bm_lockres)' is a
> no-op. According to resource handling in case of error a few lines below,
> it is likely that 'bitmap_free(bitmap)' was expected instead.
>
> Fixes: b98938d16a10 ("md-cluster: introduce cluster_check_sync_size")

Reviewed-by: Guoqing Jiang <gqjiang@suse.com>

Thanks,
Guoqing

>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/md/md-cluster.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
> index b21ef58819f6..7299ce2f08a8 100644
> --- a/drivers/md/md-cluster.c
> +++ b/drivers/md/md-cluster.c
> @@ -1127,7 +1127,7 @@ int cluster_check_sync_size(struct mddev *mddev)
>   		bm_lockres = lockres_init(mddev, str, NULL, 1);
>   		if (!bm_lockres) {
>   			pr_err("md-cluster: Cannot initialize %s\n", str);
> -			lockres_free(bm_lockres);
> +			bitmap_free(bitmap);
>   			return -1;
>   		}
>   		bm_lockres->flags |= DLM_LKF_NOQUEUE;


  reply	other threads:[~2017-04-14  6:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14  6:08 [PATCH] md-cluster: Fix a memleak in an error handling path Christophe JAILLET
2017-04-14  6:08 ` Christophe JAILLET
2017-04-14  6:23 ` Guoqing Jiang [this message]
2017-04-14  6:23   ` Guoqing Jiang

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=58F06AFC.509@suse.com \
    --to=gqjiang@suse.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=shli@kernel.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.