All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: Jing Wang <windsdaemon@gmail.com>
Cc: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH 1/1] drbd: check return of kmalloc in receive_uuids
Date: Mon, 29 Oct 2012 11:26:27 +0100	[thread overview]
Message-ID: <5124709.NeBDm9xAYE@fat-tyre> (raw)
In-Reply-To: <1351148456-11129-1-git-send-email-windsdaemon@gmail.com>

Hi,

Thanks for pointint this out. I fixed your patch for the drbd-8.3
context and applied it. See:
http://git.drbd.org/gitweb.cgi?p=drbd-8.3.git;a=commit;h=371289b8b632e8b4e364563faa430ff3b6d7d1d9

best,
 Phil

> Signed-off-by: Jing Wang <windsdaemon@gmail.com>
> ---
>  drivers/block/drbd/drbd_receiver.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/drbd/drbd_receiver.c
> b/drivers/block/drbd/drbd_receiver.c index c74ca2d..4227f38 100644
> --- a/drivers/block/drbd/drbd_receiver.c
> +++ b/drivers/block/drbd/drbd_receiver.c
> @@ -3076,10 +3076,14 @@ static int receive_sizes(struct drbd_conf *mdev,
> enum drbd_packets cmd, unsigned static int receive_uuids(struct drbd_conf
> *mdev, enum drbd_packets cmd, unsigned int data_size) {
>  	struct p_uuids *p = &mdev->data.rbuf.uuids;
> -	u64 *p_uuid;
> +	u64 *p_uuid = NULL;
>  	int i, updated_uuids = 0;
> 
>  	p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO);
> +	if (!p_uuid) {
> +		dev_err(DEV, "kmalloc of p_uuid failed\n");
> +		return -ENOMEM;
> +	}
> 
>  	for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++)
>  		p_uuid[i] = be64_to_cpu(p->uuid[i]);

      reply	other threads:[~2012-10-29 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  7:00 [Drbd-dev] [PATCH 1/1] drbd: check return of kmalloc in receive_uuids Jing Wang
2012-10-29 10:26 ` Philipp Reisner [this message]

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=5124709.NeBDm9xAYE@fat-tyre \
    --to=philipp.reisner@linbit.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=windsdaemon@gmail.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 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.