linux/drivers/s390
Julian Wiedmann 6be687395b s390/qeth: free netdevice when removing a card
On removal, a qeth card's netdevice is currently not properly freed
because the call chain looks as follows:

qeth_core_remove_device(card)
	lx_remove_device(card)
		unregister_netdev(card->dev)
		card->dev = NULL			!!!
	qeth_core_free_card(card)
		if (card->dev)				!!!
			free_netdev(card->dev)

Fix it by free'ing the netdev straight after unregistering. This also
fixes the sysfs-driven layer switch case (qeth_dev_layer2_store()),
where the need to free the current netdevice was not considered at all.

Note that free_netdev() takes care of the netif_napi_del() for us too.

Fixes: 4a71df5004 ("qeth: new qeth device driver")
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Reviewed-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-03-22 11:52:30 -04:00
..
block vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
char vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
cio s390/cio: fix kernel-doc usage 2018-02-05 07:34:52 +01:00
crypto treewide: Use DEVICE_ATTR_RO 2018-01-09 16:34:34 +01:00
net s390/qeth: free netdevice when removing a card 2018-03-22 11:52:30 -04:00
scsi s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
virtio virtio/s390: implement PM operations for virtio_ccw 2018-02-14 14:34:09 +02:00
Makefile s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00