Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Lars Ellenberg <drbd-dev@lists.linbit.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, Jens Axboe <jens.axboe@oracle.com>
Subject: [Drbd-dev] [patch] drbd: fix memory leak
Date: Thu, 22 Apr 2010 11:56:41 +0200	[thread overview]
Message-ID: <20100422095641.GR29647@bicker> (raw)

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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22  9:56 Dan Carpenter [this message]
2010-04-22 12:27 ` [Drbd-dev] [patch] drbd: fix memory leak Jens Axboe
2010-04-22 12:47   ` Philipp Reisner
2010-04-22 12:47     ` [Drbd-dev] [PATCH 1/1] drbd: Terminate a connection early if sending the protocol fails Philipp Reisner
2010-04-22 12:50     ` [Drbd-dev] [patch] drbd: fix memory leak Jens Axboe

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=20100422095641.GR29647@bicker \
    --to=error27@gmail.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=drbd-user@lists.linbit.com \
    --cc=jens.axboe@oracle.com \
    --cc=kamalesh@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=philipp.reisner@linbit.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