lkml.org 
[lkml]   [2006]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 4/7][PATCH] AMBA DMA: Add a driver module for the DMA controller.
From
Date
 > 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-30 18:27    [W:0.093 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site