Re: [RFC 4/7][PATCH] AMBA DMA: Add a driver module for the DMA controller.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 > 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux