Re: [PATCH 3/5] staging: vme: add functions for bridge module refcounting

From: Martyn Welch
Date: Mon Aug 22 2011 - 08:25:11 EST


On 13/08/11 08:47, Emilio G. Cota wrote:
> On Fri, Aug 12, 2011 at 12:30:49 +0200, Manohar Vanga wrote:
>> + struct vme_bridge *bridge;
>> +
>> + mutex_lock(&vme_buses_lock);
>> + list_for_each_entry(bridge, &vme_bus_list, bus_list) {
>> + if (bridge->num == bus_id) {
>> + if (!bridge->owner)
>> + dev_warn(bridge->parent,
>> + "bridge->owner not set\n");
>
> Don't do this; it will throw a false warning if the kernel is
> built without module support. Note that in that case
>
> THIS_MODULE == (struct module *)0.
>
> try_module_get() and module_put() do the right thing for all
> possible configs. Trust them.
>

I can confirm that this does break when the bridge is compiled into the kernel.

Martyn

--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)1327322748 | Barbirolli Square, Manchester,
E martyn.welch@xxxxxx | M2 3AB VAT:GB 927559189
--
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/