WSL2-Linux-Kernel/drivers/net/xen-netback
Filipe Manco cce94483e4 xen-netback: fix error handling on netback_probe()
In case of error during netback_probe() (e.g. an entry missing on the
xenstore) netback_remove() is called on the new device, which will set
the device backend state to XenbusStateClosed by calling
set_backend_state(). However, the backend state wasn't initialized by
netback_probe() at this point, which will cause and invalid transaction
and set_backend_state() to BUG().

Initialize the backend state at the beginning of netback_probe() to
XenbusStateInitialising, and create two new valid state transitions on
set_backend_state(), from XenbusStateInitialising to XenbusStateClosed,
and from XenbusStateInitialising to XenbusStateInitWait.

Signed-off-by: Filipe Manco <filipe.manco@neclab.eu>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 09:56:02 -04:00
..
Makefile xen-netback: add control protocol implementation 2016-05-16 13:35:56 -04:00
common.h xen-netback: add control protocol implementation 2016-05-16 13:35:56 -04:00
hash.c xen-netback: correct length checks on hash copy_ops 2016-05-20 10:51:03 -07:00
interface.c xen-netback: only deinitialized hash if it was initialized 2016-05-20 17:41:18 -04:00
netback.c xen-netback: use hash value from the frontend 2016-05-16 13:35:56 -04:00
xenbus.c xen-netback: fix error handling on netback_probe() 2016-09-17 09:56:02 -04:00