Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0a31981 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

drivers: net: rmnet: Free port after netdev unreg



Previously rmnet port would be freed before netdevice unregister
queue. This would cause an issue if any dependent drivers relied on
rmnet_port.

This change switches the order and unregisters in context instead
of a unregister queue to ensure rmnet_port is freed after all netdev_cb
notifications.

Change-Id: Id8fdae83bddc5432501ee53142ece2695e80ab64
Acked-by: default avatarRaul Martinez <mraul@qti.qualcomm.com>
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 771efa0c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -256,9 +256,9 @@ static void rmnet_dellink(struct net_device *dev, struct list_head *head)
	if (!port->nr_rmnet_devs)
		qmi_rmnet_qmi_exit(port->qmi_info, port);

	rmnet_unregister_real_device(real_dev, port);
	unregister_netdevice(dev);

	unregister_netdevice_queue(dev, head);
	rmnet_unregister_real_device(real_dev, port);
}

static void rmnet_force_unassociate_device(struct net_device *dev)
@@ -288,7 +288,9 @@ static void rmnet_force_unassociate_device(struct net_device *dev)
		synchronize_rcu();
		kfree(ep);
	}

	/* Unregistering devices in context before freeing port.
	 * If this API becomes non-context their order should switch.
	 */
	unregister_netdevice_many(&list);

	rmnet_unregister_real_device(real_dev, port);