[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ada3b95yavq.fsf@cisco.com>
Date: Mon, 30 Oct 2006 09:24:57 -0800
From: Roland Dreier <rdreier@...co.com>
To: Arjan van de Ven <arjan@...radead.org>
Cc: Peter Pearse <peter.pearse@....com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC 4/7][PATCH] AMBA DMA: Add a driver module for the DMA controller.
> this looks very very wrong to me.
Yes, the module reference counting needs to be completely redone.
This try_find_module() function is only used as:
> + pl080_driver.drv.owner = try_find_module(MODULE_NAME);
which as far as I can see should just be
pl080_driver.drv.owner = THIS_MODULE;
But there's also stuff like
> +static int pl080_request(dmach_t cnum, dma_t * cdata){
> + int retval = -EINVAL;
> +
> + /* Increase the usage */
> + if(try_module_get(pl080_driver.drv.owner)){
> + retval = 0;
> + }
which of course can never work -- this is inside the pl080 module so
it's already too late to take a reference.
The module refcounting just needs to be rethought.
- R.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists