kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] drbd: fix memory leak
@ 2010-04-22  9:56 Dan Carpenter
  2010-04-22 12:27 ` Jens Axboe
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2010-04-22  9:56 UTC (permalink / raw)
  To: kernel-janitors

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;
 		}
 	}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] drbd: fix memory leak
  2010-04-22  9:56 [patch] drbd: fix memory leak Dan Carpenter
@ 2010-04-22 12:27 ` Jens Axboe
  2010-04-22 12:47 ` Philipp Reisner
  2010-04-22 12:50 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2010-04-22 12:27 UTC (permalink / raw)
  To: kernel-janitors

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] drbd: fix memory leak
  2010-04-22  9:56 [patch] drbd: fix memory leak Dan Carpenter
  2010-04-22 12:27 ` Jens Axboe
@ 2010-04-22 12:47 ` Philipp Reisner
  2010-04-22 12:50 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Reisner @ 2010-04-22 12:47 UTC (permalink / raw)
  To: kernel-janitors

Hi Jens,

Please apply the following patch as well.

PS: I have put both at git://git.drbd.org/linux-2.6-drbd.git for-jens

Best,
 Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] drbd: fix memory leak
  2010-04-22  9:56 [patch] drbd: fix memory leak Dan Carpenter
  2010-04-22 12:27 ` Jens Axboe
  2010-04-22 12:47 ` Philipp Reisner
@ 2010-04-22 12:50 ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2010-04-22 12:50 UTC (permalink / raw)
  To: kernel-janitors

On Thu, Apr 22 2010, Philipp Reisner wrote:
> Hi Jens,
> 
> Please apply the following patch as well.
> 
> PS: I have put both at git://git.drbd.org/linux-2.6-drbd.git for-jens

Thanks, I just hand applied the 2nd one since the first one was already
there.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-04-22 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22  9:56 [patch] drbd: fix memory leak Dan Carpenter
2010-04-22 12:27 ` Jens Axboe
2010-04-22 12:47 ` Philipp Reisner
2010-04-22 12:50 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).