Commit 2ebb939ab9c6a2484866c5eae4184c83c2b21af8

Authored by David Vrabel
Committed by Konrad Rzeszutek Wilk
1 parent 01bc825f63

xen-kbdfront: handle backend CLOSED without CLOSING

Backend drivers shouldn't transistion to CLOSED unless the frontend is
CLOSED.  If a backend does transition to CLOSED too soon then the
frontend may not see the CLOSING state and will not properly shutdown.

So, treat an unexpected backend CLOSED state the same as CLOSING.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

drivers/input/misc/xen-kbdfront.c
... ... @@ -311,7 +311,6 @@
311 311 case XenbusStateReconfiguring:
312 312 case XenbusStateReconfigured:
313 313 case XenbusStateUnknown:
314   - case XenbusStateClosed:
315 314 break;
316 315  
317 316 case XenbusStateInitWait:
... ... @@ -350,6 +349,10 @@
350 349  
351 350 break;
352 351  
  352 + case XenbusStateClosed:
  353 + if (dev->state == XenbusStateClosed)
  354 + break;
  355 + /* Missed the backend's CLOSING state -- fallthrough */
353 356 case XenbusStateClosing:
354 357 xenbus_frontend_closed(dev);
355 358 break;