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

From: Arjan van de Ven
Date: Mon Oct 30 2006 - 07:14:17 EST


On Mon, 2006-10-30 at 12:02 +0000, Peter Pearse wrote:
> }
> +/*
> + * Export wrapped find_module to allow drivers to find their modules
> + * Useful for e.g. controlling the usage count
> + */
> +struct module *try_find_module(const char *name)
> +{
> + struct module *mod;
> + mutex_lock(&module_mutex);
> + mod = find_module(name);
> + mutex_unlock(&module_mutex);
> + return mod;
> +}
> +EXPORT_SYMBOL(try_find_module);
> +

this looks very very wrong to me.
It's racey for one, and for another, module names sound wrong. You want
to be using the symbol it provides instead, and then use __symbol_get()
and friends...

--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/