From patchwork Tue Jun 16 15:35:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 224443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FEE5C433DF for ; Tue, 16 Jun 2020 15:57:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4CD4F21534 for ; Tue, 16 Jun 2020 15:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592323029; bh=d97WpFy+5OREEuxVaheOyuxtpt3chE+sXqbZmAI3iho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KIiuquAxwuBI2g3o0YMzx5OfmXmnwwPUeHgeuLzUx4H3h+wot9GvhJU3gd15Gt6JE hFL/qnqn9WaJHU8UouNBzAlJQS1SyK/p8Xm5OOLV0V31RUlH43j0g8zUdD/dtjQua7 wiqcDMahyFlWXilcsF4cJFpSgkwHqDRZxhNx1B8c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730172AbgFPP5I (ORCPT ); Tue, 16 Jun 2020 11:57:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:55536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732857AbgFPPz0 (ORCPT ); Tue, 16 Jun 2020 11:55:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 282F1216C4; Tue, 16 Jun 2020 15:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322926; bh=d97WpFy+5OREEuxVaheOyuxtpt3chE+sXqbZmAI3iho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jsq//8UHfo42HZA+84ukwwiKu4sgizIgr+sDiVJwCoxutDqqOCRhvTcXQHshFrdmu d2dChZHd+lgNTLWUAcfvN9AuEE436EUIry2+zypZBYXOh6Ji6H6dJGqi0Dn77H+5zn QEvTT/mbd4nqMXRpS1SJlwsP1uI9IlcimatRuV9c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Stefano Stabellini , Boris Ostrovsky Subject: [PATCH 5.6 157/161] xen/pvcalls-back: test for errors when calling backend_connect() Date: Tue, 16 Jun 2020 17:35:47 +0200 Message-Id: <20200616153113.827943075@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.402291280@linuxfoundation.org> References: <20200616153106.402291280@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Juergen Gross 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 Link: https://lore.kernel.org/r/20200511074231.19794-1-jgross@suse.com Reviewed-by: Stefano Stabellini Signed-off-by: Boris Ostrovsky Signed-off-by: Greg Kroah-Hartman --- drivers/xen/pvcalls-back.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/xen/pvcalls-back.c +++ b/drivers/xen/pvcalls-back.c @@ -1087,7 +1087,8 @@ static void set_backend_state(struct xen case XenbusStateInitialised: switch (state) { case XenbusStateConnected: - backend_connect(dev); + if (backend_connect(dev)) + return; xenbus_switch_state(dev, XenbusStateConnected); break; case XenbusStateClosing: