Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2341202imm; Sat, 28 Jul 2018 15:00:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpchZWWWUX3VecNVMD/uFWdS6tOovoS6ptnFCQF8BocZnt1rVlvfiGweT33sHJpdskbW6pbQ X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr10928413plp.194.1532815252284; Sat, 28 Jul 2018 15:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532815252; cv=none; d=google.com; s=arc-20160816; b=BQXv+hr6xRYIy0DT0rIu0cOQbg5PU14YAawLfvRxjFyq5zwYB220tFRlexUjuztmwm EVXzUzLS7R9R91fzPVvu0dgl+8wVMoXb7GJ5AnqDD/JmruD0zyf5IQaMJq5yB0PuxTGq LQKFCdcw0CYpHDdVQ8cQgE9XXyqpEsjgn4m9LUueZuI+RbfF8uctsjIK51DqzX/3vvVJ jamFlEchk/kRG0SYl/LFMGjyvvhUioxYAThEmMqU+7LomuQ2xoVr15Z4B8iuOpGT4GSy bxi+ntMGTPBvJU1ymgU2U7iG5+926OYwHmfSjrko96aeEpTZn4SX6QFxV6Z3amcqkeRa 1gbg== 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=PZe3wRe86PaRq9woKF/YlJqs2Y+KYVhHmPV5vL+czgo=; b=OnMLTPo9DHm1KGdieD7nl6Nr8IGw8dALlyw6hGUY5hixYOklHB+w3VY6lpPS4hpavo uNHSBOGxkiPihamrWf/ZLJlnZjHhEzvln91NQ5Sd9UiacfVFoNHa7+JHuWv7MEgTVSOZ cEezxetNPU/AudTs/NKPkAigWV+utI4i0B/lZhl87nv//Ms1EzLJML63/jyGSAjjc7E4 N3q1lZz7vr4J5F1S7iSH4pgDSbaEeIAt7vJ94NohTp79VfcCWjghkt+kGdNMVV76k3XF F9Y+d5n+JiRkkFWapxzyMjDOX4HzlbvBJC/hN21rD4tGqs83sZC3L5/JyfG9C6ra8JmP N47Q== 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 3-v6si6666264pld.36.2018.07.28.15.00.38; Sat, 28 Jul 2018 15:00:52 -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 S1731449AbeG1X1u (ORCPT + 99 others); Sat, 28 Jul 2018 19:27:50 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:36422 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731325AbeG1X1t (ORCPT ); Sat, 28 Jul 2018 19:27:49 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id jXEgfT4OZcdsPjXEgfEHSJ; 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-0003bZ-3w; 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 1/4] Drivers: hv: vmus: Fix the check for return value from kmsg get dump buffer Date: Sat, 28 Jul 2018 21:58:45 +0000 Message-Id: <20180728215848.13814-1-kys@linuxonhyperv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180728215630.13712-1-kys@linuxonhyperv.com> References: <20180728215630.13712-1-kys@linuxonhyperv.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfHpRW3skzL7BQ7fezs190zWih24vVFJGAOVhcP4/i7FTr5SyoOISDid5EppW7XU5THS/Eb+yyK5uQB+gUJJ7p3TfNvJ4lZyayGDeAwnsvGHKB7/IrLwQ QqUFwE1cSgjfiiB955AwHrZwKFPy3QOz3dmRB7Tnxo3FgDclCVJ+LxAmCwedooC53stllc0/xEs5C4NXIxYFA5OXmdL+0zHgJV2mLVeCXSJ7FqUOYJUZbzI7 LRC3xBD+QCURuPTFeLbMjBussZ4r+2JqW2vGxCcD0bh/DP8kM2EjFyoHxPMpKqfX2dH55s+fhsAqsIQU6MjTmlb5/PimVqUCw7Cjyro3IpuXWgYI9zMREl0n pGB8o0tEZ34Q29BQkcGC0gfD9wOcLd+HC+vGANnIMLDWq5nj5E3eQAfb7UrfcFQBVK2nOJ2jeAC0gCvf1Dx7RMuY5cRxbiXzHmC9xguHwWl1AsAfgGmBPkxV u3C1Q207yHdL+3yckd9oQwOcKwmjP1CvYpsCGc3Pw0F3uniCEDnHcE9B9zuA1V3sWW15/2zfhXErggyttCj4nsMwdM3C52lrPT9cjA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sunil Muthuswamy The code to support panic control message was checking the return was checking the return value from kmsg_dump_get_buffer as error value, which is not what the routine returns. 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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 05e37283d7c3..a7f33c1f42c5 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1047,13 +1047,10 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, * Write dump contents to the page. No need to synchronize; panic should * be single-threaded. */ - if (!kmsg_dump_get_buffer(dumper, true, hv_panic_page, - PAGE_SIZE, &bytes_written)) { - pr_err("Hyper-V: Unable to get kmsg data for panic\n"); - return; - } - - hyperv_report_panic_msg(panic_pa, bytes_written); + kmsg_dump_get_buffer(dumper, true, hv_panic_page, PAGE_SIZE, + &bytes_written); + if (bytes_written) + hyperv_report_panic_msg(panic_pa, bytes_written); } static struct kmsg_dumper hv_kmsg_dumper = { -- 2.17.1