Messages in this thread | | | Subject | Re: [PATCH] EVMS core (3/9) discover.c | From | Andi Kleen <> | Date | 10 Oct 2002 22:48:42 +0200 |
| |
Kevin Corry <corryk@us.ibm.com> writes:
> + list_for_each_entry(plugin, &plugin_head, headers) { > + if (GetPluginType(plugin->id) == EVMS_DEVICE_MANAGER) { > + spin_unlock(&plugin_lock); > + DISCOVER(plugin, disk_list); > + spin_lock(&plugin_lock); > + }
How do you know "plugin" and its successors are still valid when retaking the spinlock? Looks like you need a reference count on the object here.
Similar with other functions.
> + > + if (!gd) { > + gd = alloc_disk(); > + BUG_ON(!gd);
BUG_ON ? Can't this fail for legal reasons?
-Andi - 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/
| |