Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2342558imm; Sat, 28 Jul 2018 15:02:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdIOytn9XbLnX+kRde8g4go+rQtfXS39jAHpBG5OeikuLXcvPnGm1KJxGAiEJforR6q95mD X-Received: by 2002:a62:4b48:: with SMTP id y69-v6mr11993170pfa.93.1532815320005; Sat, 28 Jul 2018 15:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532815319; cv=none; d=google.com; s=arc-20160816; b=jCMVMDB60Wyd6GdtvLf9o0GCT8La8h3wLd7Eto1UlfVphbMuD3CJUhqagOIUPSP5BM DNC+JOCRlrmJ9KUisHEe9mvBEQvdewlrzOWWlFXcxMZLU1Wix3A5K95VR4jnXfzIRNfB nssNd3Vtdre3bCZZtxnXIpQT+ujrzcxnPrgZOn1xltvdq5i0CFJnDp0rcgGVIULXJAO/ OUU2xkXluZo8Qx6kGpZzEoeyenMdNmuXjS3aXbzCTSeJ8jrDZNoQEReErxTm6aWXctbZ DBesil3KvvQuaCwQzSyPz41lamL6F9nJ5pzCOPyyHoBrngJB3uMEpsxhDt6b5VojYnA0 /AFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=wMyCNaOXR6h1i4maQQmxslFvvyLplCDUR10otUewoVA=; b=R8UFMV90EclPlrR0YTEKH541s1KRCxq+9ss6OGytdOtWMFbwdNDiLG4d7SosE2fCoB D80padevf6dBdpB5hua8uVmCkCSdp3M4sMGW3DFwq9YybPPRTeI3Th9LYSgms8u2dmYu ncxog/9wT5GJldvClLc5XSlQF+LtNFE7MHzwiqj7WVrFYKFhBciSeJgfUCXFqbozuH4L g9cfoUgvDOUtuhBBGjVCxOnCrGJ/jAXnRRyvVmnynRBoaXqstGLtNEpyggjUt4NPeqLF 3cVRbpBXHI/Co6KRobTbssvrpWTHLSlHxblA0jhUbeqvdSTiJJFT25BLBWFaK7CkcgC8 I6Ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h18-v6si6674156pfn.158.2018.07.28.15.01.45; Sat, 28 Jul 2018 15:01:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731358AbeG1X1t (ORCPT + 99 others); Sat, 28 Jul 2018 19:27:49 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:47024 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731319AbeG1X1s (ORCPT ); Sat, 28 Jul 2018 19:27:48 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id jXEgfr8e6dH2EjXEgfTCdH; Sat, 28 Jul 2018 14:58:50 -0700 x-originating-ip: 107.180.71.197 Received: from kys by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1fjXEg-0003bd-7w; Sat, 28 Jul 2018 14:58:50 -0700 From: kys@linuxonhyperv.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com, sthemmin@microsoft.com, Michael.H.Kelley@microsoft.com, vkuznets@redhat.com Cc: Sunil Muthuswamy , "K . Y . Srinivasan" Subject: [PATCH 2/4] Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr Date: Sat, 28 Jul 2018 21:58:46 +0000 Message-Id: <20180728215848.13814-2-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180728215848.13814-1-kys@linuxonhyperv.com> References: <20180728215630.13712-1-kys@linuxonhyperv.com> <20180728215848.13814-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfEwWbiJ7PUSLMscpTnCdWx8zRMXtbPOuJEo4EZHm8O0ic1As6oXkWIsHROl7O8h0wsER+boxOg1BQozrZczDPG3PoUtdtCcGOOpci2Hk1zl50HjM9mEr DSkzZeQByYV9xLl1r461Dbw44U1qq4mboMqQX1URnL3OHwBQNMkgP2w46pw8ZQy1wnM0Khq7DMI6Zf+y8NGlmQ8lxQoyme9yzRjrifg3j8bkOmlVU+rHRGb2 iIr7B48ippkTepqzRxRuqUDCke2cu/VGOFTY390Ut3O1f2fEF720g65N3Z1AIjxBVCeDeHvnVEba6h4xMlgfsmxFGmZF4wMqS0uaK1eTifstSZ1KKqOJCN0+ OR4THnG4X8FlmAQ7eWWguqGygwU9ibuD41OezI/OUpGK7W0hJFrfifF6kxxmS5oYzfRmXbTtFd4NNDnvJdhoPgsGEw3v9BTNgBqPCNKkuaGVBgi/7aLm8p7S PXC6gwwOsVica+SdiKcHXbreydsycdNsC3o5g0Qr1kuycXYzYyqiG6ts89Od/BszJCZoTVrzvL4WcPJPtI+CgR8O2WeVbDXlWDMuqw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sunil Muthuswamy The check to free the Hyper-V control table header was reversed. This fixes it. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Signed-off-by: Sunil Muthuswamy Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index a7f33c1f42c5..5e946b1be54c 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1176,11 +1176,8 @@ static int vmbus_bus_init(void) bus_unregister(&hv_bus); free_page((unsigned long)hv_panic_page); - if (!hv_ctl_table_hdr) { - unregister_sysctl_table(hv_ctl_table_hdr); - hv_ctl_table_hdr = NULL; - } - + unregister_sysctl_table(hv_ctl_table_hdr); + hv_ctl_table_hdr = NULL; return ret; } @@ -1891,11 +1888,8 @@ static void __exit vmbus_exit(void) } free_page((unsigned long)hv_panic_page); - if (!hv_ctl_table_hdr) { - unregister_sysctl_table(hv_ctl_table_hdr); - hv_ctl_table_hdr = NULL; - } - + unregister_sysctl_table(hv_ctl_table_hdr); + hv_ctl_table_hdr = NULL; bus_unregister(&hv_bus); cpuhp_remove_state(hyperv_cpuhp_online); -- 2.17.1