Device initialization code usually first loads a subdriver
(via qeth_core_load_discipline()), and then runs its setup() callback.
If this fails, it rolls back the load via qeth_core_free_discipline().
qeth_core_free_discipline() expects the options.layer attribute to be
initialized, but on error in setup() that's currently not the case.
Resulting in misbalanced symbol_put() calls.
Fix this by setting options.layer when loading the subdriver.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
return -EINVAL;
}
+ card->options.layer = discipline;
return 0;
}
symbol_put(qeth_l2_discipline);
else
symbol_put(qeth_l3_discipline);
+ card->options.layer = QETH_DISCIPLINE_UNDETERMINED;
card->discipline = NULL;
}
card->discipline->remove(card->gdev);
qeth_core_free_discipline(card);
- card->options.layer = QETH_DISCIPLINE_UNDETERMINED;
-
free_netdev(card->dev);
card->dev = ndev;
}
}
INIT_LIST_HEAD(&card->vid_list);
hash_init(card->mac_htable);
- card->options.layer = QETH_DISCIPLINE_LAYER2;
card->info.hwtrap = 0;
qeth_l2_vnicc_set_defaults(card);
return 0;
}
hash_init(card->ip_htable);
hash_init(card->ip_mc_htable);
- card->options.layer = QETH_DISCIPLINE_LAYER3;
card->info.hwtrap = 0;
return 0;
}