summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2020-05-11 09:42:31 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-17 16:42:08 +0200
commit2bdc48dc330a6227cdaffbb66c368ba1f296dca1 (patch)
tree725729e7eb59e39f1f51cd824ac4363fd7adfad4
parentd8dae473db3c9461a80f60a90c2fe15177f108e2 (diff)
downloadlinux-stable-2bdc48dc330a6227cdaffbb66c368ba1f296dca1.tar.gz
linux-stable-2bdc48dc330a6227cdaffbb66c368ba1f296dca1.tar.bz2
linux-stable-2bdc48dc330a6227cdaffbb66c368ba1f296dca1.zip
xen/pvcalls-back: test for errors when calling backend_connect()
commit c8d70a29d6bbc956013f3401f92a4431a9385a3c upstream. backend_connect() can fail, so switch the device to connected only if no error occurred. Fixes: 0a9c75c2c7258f2 ("xen/pvcalls: xenbus state handling") Cc: stable@vger.kernel.org Signed-off-by: Juergen Gross <jgross@suse.com> Link: https://lore.kernel.org/r/20200511074231.19794-1-jgross@suse.com Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/xen/pvcalls-back.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
index c57c71b7d53d..ffe9bd843922 100644
--- a/drivers/xen/pvcalls-back.c
+++ b/drivers/xen/pvcalls-back.c
@@ -1087,7 +1087,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: