All of lore.kernel.org
 help / color / mirror / Atom feed
From: Haavard Skinnemoen <hskinnemoen@atmel.com>
To: Shannon Nelson <shannon.nelson@intel.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	shannon.nelson@intel.com, greg@kroah.com,
	dan.j.williams@intel.com
Subject: Re: [PATCH] DMAENGINE: too many kref_put calls
Date: Sat, 27 Oct 2007 15:28:16 +0200	[thread overview]
Message-ID: <20071027152816.2d447c70@siona> (raw)
In-Reply-To: <20071026235648.5737.45405.stgit@localhost.localdomain>

On Fri, 26 Oct 2007 16:56:48 -0700
Shannon Nelson <shannon.nelson@intel.com> wrote:

> @@ -134,8 +134,7 @@ static void dma_async_device_cleanup(struct kref
> *kref); 
>  static void dma_dev_release(struct device *dev)
>  {
> -	struct dma_chan *chan = to_dma_chan(dev);
> -	kref_put(&chan->device->refcount, dma_async_device_cleanup);
> +	return;
>  }

Hmm...what prevents dma_chan_cleanup() from being called while someone
still holds a reference to the "class" device? This will allow the
module removal to proceed, the device to be freed, and things will blow
up...

I think my patch is better. By taking two references, the order in
which the cleanup functions are called doesn't matter -- both have to
complete before the module removal is allowed to proceed.

Håvard

      parent reply	other threads:[~2007-10-27 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 23:56 [PATCH] DMAENGINE: too many kref_put calls Shannon Nelson
2007-10-27  6:40 ` Al Viro
2007-10-27 13:28 ` Haavard Skinnemoen [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=20071027152816.2d447c70@siona \
    --to=hskinnemoen@atmel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shannon.nelson@intel.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.