|
@@ -498,10 +498,8 @@ struct eth_init {
|
|
|
int index;
|
|
|
};
|
|
|
|
|
|
-/* Filled in at boot time. Will need locking if the transports become
|
|
|
- * modular.
|
|
|
- */
|
|
|
-struct list_head transports = LIST_HEAD_INIT(transports);
|
|
|
+static DEFINE_SPINLOCK(transports_lock);
|
|
|
+static LIST_HEAD(transports);
|
|
|
|
|
|
/* Filled in during early boot */
|
|
|
struct list_head eth_cmd_line = LIST_HEAD_INIT(eth_cmd_line);
|
|
@@ -540,7 +538,10 @@ void register_transport(struct transport *new)
|
|
|
char *mac = NULL;
|
|
|
int match;
|
|
|
|
|
|
+ spin_lock(&transports_lock);
|
|
|
+ BUG_ON(!list_empty(&new->list));
|
|
|
list_add(&new->list, &transports);
|
|
|
+ spin_unlock(&transports_lock);
|
|
|
|
|
|
list_for_each_safe(ele, next, ð_cmd_line){
|
|
|
eth = list_entry(ele, struct eth_init, list);
|