linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Henri Häkkinen" <henuxd@gmail.com>
Cc: gregkh@suse.de, ossama.othman@intel.com, alan@linux.intel.com,
	mattij.lammi@gmail.com, randy.dunlap@oracle.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Staging: memrar: Fixed memrar_handler.c
Date: Thu, 24 Jun 2010 10:09:48 +0100	[thread overview]
Message-ID: <20100624100948.6446f8bd@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1277363386-4817-2-git-send-email-henuxd@gmail.com>

>  size_t memrar_allocator_largest_free_area(struct memrar_allocator *allocator)
>  {
> -	if (allocator == NULL)
> -		return 0;
> -	return allocator->largest_free_area;
> +	size_t tmp = 0;
> +
> +	if (allocator != NULL) {
> +		mutex_lock(&allocator->lock);
> +		tmp = allocator->largest_free_area;
> +		mutex_unlock(&allocator->lock);

This doesn't seem to make any sense (in either version). The moment you
drop the lock the value in "tmp" becomes stale as the allocator could
change it. ?



  reply	other threads:[~2010-06-24  9:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24  7:09 [PATCH 1/2] Staging: memrar: Moved memrar_allocator struct to memrar_allocator.c Henri Häkkinen
2010-06-24  7:09 ` [PATCH 2/2] Staging: memrar: Fixed memrar_handler.c Henri Häkkinen
2010-06-24  9:09   ` Alan Cox [this message]
2010-06-24 17:36     ` Othman, Ossama
2010-06-24  9:16 ` [PATCH 1/2] Staging: memrar: Moved memrar_allocator struct to memrar_allocator.c Alan Cox
2010-06-24  9:27   ` Henri Häkkinen

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=20100624100948.6446f8bd@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=alan@linux.intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=henuxd@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattij.lammi@gmail.com \
    --cc=ossama.othman@intel.com \
    --cc=randy.dunlap@oracle.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;
as well as URLs for NNTP newsgroup(s).