Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1652590ybk; Mon, 11 May 2020 00:44:40 -0700 (PDT) X-Google-Smtp-Source: APiQypL1G2lCWWc3nuEEnkRt0vFatdXQMBTyDnrOE1QmEG1W4BCD5Kto2H7/KdjxUlrky6Y/jfMk X-Received: by 2002:a05:6402:1fc:: with SMTP id i28mr12070274edy.18.1589183080008; Mon, 11 May 2020 00:44:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589183080; cv=none; d=google.com; s=arc-20160816; b=eKpM60yF0H6yytuh8wtAn2n4Udfiz0DZkDf6lEHQ5aDApb9xdZLIyfqD1kXND7zMcm 1o4HXLIPlPf7XE9vAo6i/0I/Rshm/d2Fo099whCtHGRokAoCVEr+LVPX+TpJAE4gj1UX TfhyVjn22Km5ZcrM7H6Xs4bKjgolTnNRQNF4r38+AMwohCKoL+Toxu9lwGzuYvyeTWzI vJ7x93QHkWl7GVkmSpWVKlTQjiaTCd6+cvrFbQpWm8VF4xzOW88PNdD/xu1s/SeCJ+YW AdWYeN1NjV1W84CgMLlWdAugeMg8XJXv6/8e3yXNF3Z+Kh/GtTKHY/blKwSEekA8KqoP 4g/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KXAj78D3INgRmMIVYEqjOBzNJE62mfvT+vBskDqdVp0=; b=lcFl/oncocMLcom1Vl8yHkMKpKsoDmnN1YXyaenj3x+aCoDrLqs8s6vpYt9Jr6MnKc G0vvvQTEpTLb3pcB32IYuSSy3dM1yaxmGdRG6pehNluprUX2Djoq/MqLpGxdgAVB1RW9 mgI7tkij+UHUYQS6xUWau8mWddVEgQdj9AeLoLow+S4Gc+hYm6vCX3/msXyPLxmetz0E d/6jI4X2i0NzxLUWcgmUaDC0MGGwuOGDqh3KBmtzPCI1h9cOY25jlJHdp4gBl//a/Vs3 e+gLJmJN5O0wdOxmOmERmD38VcwST8QnkGH843c+JJ8yjnDT3mGfqQMIcn9Pwsz/16V2 L6CQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si5826680edq.326.2020.05.11.00.44.17; Mon, 11 May 2020 00:44:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728468AbgEKHmg (ORCPT + 99 others); Mon, 11 May 2020 03:42:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:52652 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbgEKHmg (ORCPT ); Mon, 11 May 2020 03:42:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 15307AC90; Mon, 11 May 2020 07:42:37 +0000 (UTC) From: Juergen Gross To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Cc: Juergen Gross , Boris Ostrovsky , Stefano Stabellini , stable@vger.kernel.org Subject: [PATCH] xen/pvcalls-back: test for errors when calling backend_connect() Date: Mon, 11 May 2020 09:42:31 +0200 Message-Id: <20200511074231.19794-1-jgross@suse.com> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/xen/pvcalls-back.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c index cf4ce3e9358d..41a18ece029a 100644 --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -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: -- 2.26.1