From patchwork Wed May 18 14:55:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 9120451 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E8B79F30C for ; Wed, 18 May 2016 15:11:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50D1A2037C for ; Wed, 18 May 2016 15:11:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5D02320377 for ; Wed, 18 May 2016 15:11:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b336S-0004UX-Fs; Wed, 18 May 2016 15:09:40 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b336R-0004UO-CP for xen-devel@lists.xenproject.org; Wed, 18 May 2016 15:09:39 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 22/07-29997-2B58C375; Wed, 18 May 2016 15:09:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRWlGSWpSXmKPExsXitHRDpO6mVpt wg91rRCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ox/J8MKNnFVPHrxlrWBsYmzi5GTQ0LAX+LY m03MIDabgI7E1KeXWEFsEQE7iXM974FsDg5mAU+JnlvmIGFhgRCJBdsOMYHYLAKqEivOLGcEs XkF3CUmTXvEAjFSTuL88Z9gI4UEVCTWT53FBlEjKHFy5hOwGmYBCYmDL14wQ9RzS9w+PZV5Ai PPLCRls5CULWBkWsWoUZxaVJZapGtorJdUlJmeUZKbmJmja2hgqpebWlycmJ6ak5hUrJecn7u JERggDECwg/HfNs9DjJIcTEqivM4VNuFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHizW4BygkWp 6akVaZk5wFCFSUtw8CiJ8GqCpHmLCxJzizPTIVKnGBWlxHkdQRICIImM0jy4Nlh8XGKUlRLmZ QQ6RIinILUoN7MEVf4VozgHo5IwbzrIFJ7MvBK46a+AFjMBLb4lBra4JBEhJdXAmL1a+6Vxsn nvZcNtT0S8/9jd1Ppe67JLufu9137+2Ceh3E/YVr2cbb31ozRL+5ZbljcL9xbIrXpo2lKk8sf RKux1g7jofY19U79E2wfKahh+XdjaWuq0ddsvnQgB/a75E/7JNegFt5VE/M96HfJ5y+Pppw84 9C6+I1YtHnVTTnCedubKYzH3lViKMxINtZiLihMBmbzpi4oCAAA= X-Env-Sender: prvs=93930de3f=Paul.Durrant@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1463584176!40118951!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9084 invoked from network); 18 May 2016 15:09:37 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 18 May 2016 15:09:37 -0000 X-IronPort-AV: E=Sophos;i="5.26,329,1459814400"; d="scan'208";a="355058265" From: Paul Durrant To: , Date: Wed, 18 May 2016 15:55:42 +0100 Message-ID: <1463583342-25085-1-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Paul Durrant , Wei Liu Subject: [Xen-devel] [PATCH net-next] xen-netback: only deinitialized hash if it was initialized X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A domain with a frontend that does not implement a control ring has been seen to cause a crash during domain save. This was apparently because the call to xenvif_deinit_hash() in xenvif_disconnect_ctrl() is made regardless of whether a control ring was connected, and hence xenvif_hash_init() was called. This patch brings the call to xenvif_deinit_hash() in xenvif_disconnect_ctrl() inside the if clause that checks whether the control ring event channel was connected. This is sufficient to ensure it is only called if xenvif_init_hash() was called previously. Signed-off-by: Paul Durrant Reported-by: Boris Ostrovsky Tested-by: Boris Ostrovsky Cc: Wei Liu Acked-by: Wei Liu --- drivers/net/xen-netback/interface.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index 1c7f49b..83deeeb 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c @@ -780,9 +780,8 @@ void xenvif_disconnect_ctrl(struct xenvif *vif) vif->ctrl_task = NULL; } - xenvif_deinit_hash(vif); - if (vif->ctrl_irq) { + xenvif_deinit_hash(vif); unbind_from_irqhandler(vif->ctrl_irq, vif); vif->ctrl_irq = 0; }