From patchwork Tue Jun 16 02:58:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1309940 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49mCZr4y28z9sRN; Tue, 16 Jun 2020 12:59:00 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jl1oO-0000WW-Gg; Tue, 16 Jun 2020 02:58:56 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jl1oM-0000Vl-0C for kernel-team@lists.ubuntu.com; Tue, 16 Jun 2020 02:58:54 +0000 Received: from mail-qt1-f200.google.com ([209.85.160.200]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jl1oL-000647-Md for kernel-team@lists.ubuntu.com; Tue, 16 Jun 2020 02:58:53 +0000 Received: by mail-qt1-f200.google.com with SMTP id x6so15686483qts.3 for ; Mon, 15 Jun 2020 19:58:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xi1pLcSc1dHZyZwGCg2NQtxOSbkw/Y0oQoO/FmAJukI=; b=mQ50vDd8D1gUaL8J4yWqZBHo3ExZY/5xz90JWBC0GGXTwyK0kiEbmF1+8Y95QV4c5c 1UuLUYLrtzcQdo122WLGmPlEEuSF6eT+KBC5KJiJ729nTZUda8RDzgSxv0OctyZb/H6+ 5grA+x+gk9rr4rv/iBJsTHqcp0OUBvUMHlJN47dKMjAgauuCxMBcaUFsMw5/sxnGfDmS vI2OYJWT+ucBW+/9sI71ZUZ8odj/zOoPo5GqH/2BTGWb6l33KcMJYKHJd2wue90ES2ig RXqco4CYcstYuDfVWaNZsCrjxwNQfdMmcbdD4seB9gKNE82uWykrn4EzOvh+SAhRbbdv BZfA== X-Gm-Message-State: AOAM530pPcVHV1fgdB8gXm+iYg42Ddv1DqMT1OlBxWO3NTEffB5VX9ss DEdlmMGGUvV+zkTpsextfjEgpIixCrFJeR3rIU+awEOooXk2KKoMF8feFju3Mqy2Mlmcz/Q8UdQ EVYWCqjWBssN0yXvdZHbWJzn5zER2+Kgo7Goff1J3 X-Received: by 2002:aed:27c7:: with SMTP id m7mr19005479qtg.138.1592276332384; Mon, 15 Jun 2020 19:58:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHyev92648hxoiNHvmXSjotsexFjaoBc7kpkhgr4VzMn35za3nVlHyiFr0F3y03eJM3MixkQ== X-Received: by 2002:aed:27c7:: with SMTP id m7mr19005472qtg.138.1592276332107; Mon, 15 Jun 2020 19:58:52 -0700 (PDT) Received: from gallifrey.lan ([2804:14c:4e6:18:74d9:26:da92:f043]) by smtp.gmail.com with ESMTPSA id i14sm12397109qkl.105.2020.06.15.19.58.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 19:58:51 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [bionic:linux-azure-4.15][PATCH 3/9] Drivers: hv: vmbus: Fix the issue with freeing up hv_ctl_table_hdr Date: Mon, 15 Jun 2020 23:58:36 -0300 Message-Id: <20200616025842.102415-4-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200616025842.102415-1-marcelo.cerri@canonical.com> References: <20200616025842.102415-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Sunil Muthuswamy BugLink: http://bugs.launchpad.net/bugs/1875456 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 Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 8afc06dd75c06b9d6e70e4a72fdafbd4cab8d1df) Signed-off-by: Marcelo Henrique Cerri --- 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 c83b5c253e30..678576db5273 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1226,11 +1226,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; } @@ -1927,11 +1924,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);