All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] drbd: fix memory leak
Date: Thu, 22 Apr 2010 12:27:19 +0000	[thread overview]
Message-ID: <20100422122719.GH27497@kernel.dk> (raw)
In-Reply-To: <20100422095641.GR29647@bicker>

On Thu, Apr 22 2010, Dan Carpenter wrote:
> We leak memory if "--dry-run" is not supported by the peer.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index 67e0fc5..93d1f9b 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -1695,6 +1695,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
>  			cf |= CF_DRY_RUN;
>  		else {
>  			dev_err(DEV, "--dry-run is not supported by peer");
> +			kfree(p);
>  			return 0;
>  		}
>  	}

Yep, that's a leak. I have applied it for 2.6.34.

-- 
Jens Axboe


WARNING: multiple messages have this Message-ID (diff)
From: Jens Axboe <jens.axboe@oracle.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>,
	kernel-janitors@vger.kernel.org,
	Philipp Reisner <philipp.reisner@linbit.com>,
	drbd-user@lists.linbit.com,
	Lars Ellenberg <drbd-dev@lists.linbit.com>
Subject: Re: [Drbd-dev] [patch] drbd: fix memory leak
Date: Thu, 22 Apr 2010 14:27:19 +0200	[thread overview]
Message-ID: <20100422122719.GH27497@kernel.dk> (raw)
In-Reply-To: <20100422095641.GR29647@bicker>

On Thu, Apr 22 2010, Dan Carpenter wrote:
> We leak memory if "--dry-run" is not supported by the peer.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index 67e0fc5..93d1f9b 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -1695,6 +1695,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
>  			cf |= CF_DRY_RUN;
>  		else {
>  			dev_err(DEV, "--dry-run is not supported by peer");
> +			kfree(p);
>  			return 0;
>  		}
>  	}

Yep, that's a leak. I have applied it for 2.6.34.

-- 
Jens Axboe


  reply	other threads:[~2010-04-22 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22  9:56 [patch] drbd: fix memory leak Dan Carpenter
2010-04-22  9:56 ` [Drbd-dev] " Dan Carpenter
2010-04-22 12:27 ` Jens Axboe [this message]
2010-04-22 12:27   ` Jens Axboe
2010-04-22 12:47 ` Philipp Reisner
2010-04-22 12:47   ` [Drbd-dev] " Philipp Reisner
2010-04-22 12:50 ` Jens Axboe
2010-04-22 12:50   ` [Drbd-dev] " Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2010-04-22 12:47 [PATCH 1/1] drbd: Terminate a connection early if sending the protocol fails Philipp Reisner
2010-04-22 12:47 ` [Drbd-dev] " Philipp Reisner
2024-11-27 11:20 [PATCH] drbd: Fix memory leak zhengbing.huang
2024-12-13 15:59 ` Joel Colledge

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=20100422122719.GH27497@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=kernel-janitors@vger.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.