This is a partial fix for a more pervasive problem, that destroying a
dp_dev races with its transmit work function (dp_dev_do_xmit) running.
A "better" and "correct" fix has been written, but unfortunately it seems
to be buggy and crash the system so far.
p->dp->n_ports--;
+ if (is_dp_dev(p->dev)) {
+ /* Make sure that no packets arrive from now on, since
+ * dp_dev_xmit() will try to find itself through
+ * p->dp->ports[], and we're about to set that to null. */
+ netif_tx_disable(p->dev);
+ }
+
/* First drop references to device. */
dev_set_promiscuity(p->dev, -1);
list_del_rcu(&p->node);