Skip to content

Commit

Permalink
xen/pvcalls-back: test for errors when calling backend_connect()
Browse files Browse the repository at this point in the history
backend_connect() can fail, so switch the device to connected only if
no error occurred.

Fixes: 0a9c75c ("xen/pvcalls: xenbus state handling")
Cc: [email protected]
Signed-off-by: Juergen Gross <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
  • Loading branch information
jgross1 authored and Boris Ostrovsky committed May 21, 2020
1 parent b9bbe6e commit c8d70a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/xen/pvcalls-back.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,8 @@ static void set_backend_state(struct xenbus_device *dev,
case XenbusStateInitialised:
switch (state) {
case XenbusStateConnected:
backend_connect(dev);
if (backend_connect(dev))
return;
xenbus_switch_state(dev, XenbusStateConnected);
break;
case XenbusStateClosing:
Expand Down

0 comments on commit c8d70a2

Please sign in to comment.