Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3199204imu; Mon, 17 Dec 2018 15:20:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/XBGVWNTZolD4bjbk6VUuqbIBDQRW6VHEnI9f3WG6vXV6BgiUilovwXTbdN1aqJZVnZvf4v X-Received: by 2002:a17:902:1e9:: with SMTP id b96mr14374046plb.150.1545088821126; Mon, 17 Dec 2018 15:20:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545088821; cv=none; d=google.com; s=arc-20160816; b=xTh096aoOLe+OuOrfIsFoF3rKLOOa4eW8A6Wqi2cUeajKHsLYHJenhxDBuQbUmCISr 2TLuaMIM0HEvvcbGC5Ah2vgRiSZw4lWvOnxbX1Y1Lh6V9dP4jkVzYTvMcXU8gqDT4Ajn Ki6MHGMBjKUgJBxrgzX4Dz3mZzK1YuulXKxWuEQJs+9EuvOZC2fPgkjOVK66kDPOJAhX KPAzu1CwOB0ohXQlvm0dvyhO6nc/ApDi1IRDcUMB3TlKKgkbvJWan/xbbzB+j9RdcYJe culc4tobo/se3INLmzD6CLsVe1CEm3huWJ1TzkEEpJdbAGAmQXK4Nx8qjK4aW0v0iqJI 0cJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:msip_labels :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=fJVjXhnthKb7lvYw29FfZlZc4Lu9kz2tPStc8LEna24=; b=Ig1EykBKWNZzi6kzI9KliPaYef5DYx+gSHNhykV+qGJfsRbXKSHzq0l2NNVHftXHfj 8DrIeAuYeEv/jrHR16PHPya8p6cvcXd2BRSanO6gFKz8LNwNwje00kQMXfk/owtxrksv WbH7NZIb72T3karov1IqV1of3XfIjHA/G2/lcJ5f04JzGF+TjC/3GWvj5MT8z0UjJv/P /VIf/KLfxTGzRKd1X2v+pXl6xXuhdHnYjUVOR4+DMgyNqxW+gv04rGlGuj07rqFp1LTJ xAtwUot0WGpg/L6pQ93P907N5xd8NH0iR76axi9AnL5msC7f/uzDlhQC6xsDCOK6PaZe EseA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WVJwMH1Z; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si11849968plg.62.2018.12.17.15.20.06; Mon, 17 Dec 2018 15:20:21 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=WVJwMH1Z; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389403AbeLQUQj (ORCPT + 99 others); Mon, 17 Dec 2018 15:16:39 -0500 Received: from mail-eopbgr1300117.outbound.protection.outlook.com ([40.107.130.117]:40423 "EHLO APC01-HK2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387922AbeLQUQj (ORCPT ); Mon, 17 Dec 2018 15:16:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fJVjXhnthKb7lvYw29FfZlZc4Lu9kz2tPStc8LEna24=; b=WVJwMH1ZOO7sAfdYGjB4QxtgdnCeit18Dab8qtTqr3qBPKa8oBZV9CpU7Im9reZVWLnt3prYmSgcXIPRNwSYGTL3F7VEe4VJ+0SzGL1qUUCAxqk08Vb2bkgMcwDUYkv5P7qbXz6Xin3HbIBu40TKcaJi5SMrXhVlUSCD4l9SVEc= Received: from PU1P153MB0169.APCP153.PROD.OUTLOOK.COM (10.170.189.13) by PU1P153MB0153.APCP153.PROD.OUTLOOK.COM (10.170.188.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.4; Mon, 17 Dec 2018 20:16:10 +0000 Received: from PU1P153MB0169.APCP153.PROD.OUTLOOK.COM ([fe80::99da:e3db:6b66:c8d4]) by PU1P153MB0169.APCP153.PROD.OUTLOOK.COM ([fe80::99da:e3db:6b66:c8d4%6]) with mapi id 15.20.1471.004; Mon, 17 Dec 2018 20:16:10 +0000 From: Dexuan Cui To: "'gregkh@linuxfoundation.org'" , Stephen Hemminger , Sasha Levin CC: Haiyang Zhang , KY Srinivasan , Stephen Hemminger , "'linux-kernel@vger.kernel.org'" , Michael Kelley , "'apw@canonical.com'" , "'olaf@aepfle.de'" , "'devel@linuxdriverproject.org'" , vkuznets , "'jasowang@redhat.com'" Subject: [PATCH] Drivers: hv: vmbus: Check for ring when getting debug info Thread-Topic: [PATCH] Drivers: hv: vmbus: Check for ring when getting debug info Thread-Index: AdSWRMWuPYpn4vLTQoGSu72XmS6qRQ== Date: Mon, 17 Dec 2018 20:16:09 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-12-17T20:16:05.8893155Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:2:3cb9:7d38:c591:f3ce] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;PU1P153MB0153;6:7ntN97NtlMhRHhZv1h4u5AUNG+BqgiVTV51RGO9K+Te8luo0bwKiGPHsNW5WJabQy/UK7ZzSzWRMQ2EJnx9Yw+5Lv7y5+l12AxvNr2ce234QMYjjLYJ1m1ADoUux/zTzVIJziCu5cuTN3sw2X2OKptb1uFzws6kSeWvHy9fTiuIK028RPvk2jCQ7uPDsJpquNkNemr1sSYOI6H76qzMBnpCS+aaYCZin5dBz/pFl+YxFBrbB8Eq/MS5JRXPjxmWo+GW6aM0o3js2l7GjLPPoMFEcug4RtLoegcAEYxpx3bxcbYiy2+hkxx/hojGSW/tcx4Buk7XfLQFCRecsvS8LLKAwNIKHZzE5CWRSEO4xkYI6kfFzS5ST9dg0vGY07a5Pnjk711IyqWwTYllo8HEvaulwA3QoqdS4Cj+JvFg/20TFPYg/lhvDYXidFN7lx9jrIzdOwz7VQlqrSnEb2BW/Jw==;5:+Znwb8v4PHd3u9GrmS83IsIzB025gUQg5FO+9/npUWhK6jUyVfN1iRrmgiwdFhJBuewYVPkQKWMMOxHe5xp7lC/87BH5MN/W3Lta7w0ZdAWG9g/JULmJZ8B9tpmgqn7coPB/LBTX8qZOLZ1HFHJ+imXu5SPdjg2f2Xq6SXbdSRs=;7:KicHIEZkfzIf2HpNSCZ1Wxqwq1X7SDQFtLEP8QUubI+k4ww7G4DalHyR9hfpgJ6x9t/Yj86LWcJmy1UMvzKApQF4lVS7a5ZJguhdpERQLcrTAeSqbpwGZOrFa52EJ9lHUitgI3n8hDl61tAmYNzfmA== x-ms-office365-filtering-correlation-id: c7728ce3-32a3-4fb5-b258-08d6645c7c26 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:PU1P153MB0153; x-ms-traffictypediagnostic: PU1P153MB0153: x-ms-exchange-purlcount: -3 authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(999002)(5005020)(6040522)(8220035)(2401047)(8121501046)(10201501046)(3002001)(3231475)(944501520)(2018427008)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:PU1P153MB0153;BCL:0;PCL:0;RULEID:;SRVR:PU1P153MB0153; x-forefront-prvs: 08897B549D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(136003)(396003)(39860400002)(376002)(366004)(199004)(189003)(305945005)(106356001)(7736002)(6436002)(105586002)(55016002)(53936002)(68736007)(9686003)(74316002)(97736004)(2906002)(6116002)(6636002)(10290500003)(71190400001)(86362001)(575784001)(46003)(71200400001)(86612001)(476003)(486006)(14454004)(478600001)(25786009)(7696005)(99286004)(4326008)(1511001)(10090500001)(256004)(8990500004)(33656002)(102836004)(186003)(316002)(22452003)(5660300001)(54906003)(6506007)(110136005)(14444005)(8936002)(8676002)(81156014)(81166006)(491001);DIR:OUT;SFP:1102;SCL:1;SRVR:PU1P153MB0153;H:PU1P153MB0169.APCP153.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KbG87+mnY4xRLXT+tND41TkcCOzDQUmzjpuRyhFJzLEi7FQ2Z1wha8+KW+3bQAJjRUezGPgaOt4+fSSZ6aScqnIjwwd6Xpw3giwjESZzBVPYxGDWNQ8Eb2hwbXAhG1gi7j8sqpzHlMJt0+6yNOzFTNTcp2+l1LNGUvK8jouRs5QG7px8ZVvAvbGU1KCiJYhUdFm34pMh81r3TicnX10rRPQLkiZJBVlYYioRwOIequ426Dbtx/JK8L7p2gbwY/EELDQdoR364exv3ZBAqXTJDp6/OdHCFcBEFwN7wNppiGS+69OKJdwluYzXL7v1JVQr spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7728ce3-32a3-4fb5-b258-08d6645c7c26 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2018 20:16:09.5949 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1P153MB0153 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fc96df16a1ce is good and can already fix the "return stack garbage" issue, but let's also improve hv_ringbuffer_get_debuginfo(), which would silently return stack garbage, if people forget to check channel->state or ring_info->ring_buffer, when using the function in the future. Having an error check in the function would eliminate the potential risk. Add a Fixes tag to indicate the patch depdendency. Fixes: fc96df16a1ce ("Drivers: hv: vmbus: Return -EINVAL for the sys files = for unopened channels") Cc: stable@vger.kernel.org Cc: K. Y. Srinivasan Cc: Haiyang Zhang Signed-off-by: Stephen Hemminger Signed-off-by: Dexuan Cui --- *NOTE*: the patch is based on char-misc's char-misc-linus branch. drivers/hv/ring_buffer.c | 31 ++++++++--------- drivers/hv/vmbus_drv.c | 91 ++++++++++++++++++++++++++++++++------------= ---- include/linux/hyperv.h | 5 +-- 3 files changed, 79 insertions(+), 48 deletions(-) diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c index 64d0c85..1f1a55e 100644 --- a/drivers/hv/ring_buffer.c +++ b/drivers/hv/ring_buffer.c @@ -164,26 +164,25 @@ hv_get_ringbuffer_availbytes(const struct hv_ring_buf= fer_info *rbi, } =20 /* Get various debug metrics for the specified ring buffer. */ -void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_in= fo, - struct hv_ring_buffer_debug_info *debug_info) +int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_inf= o, + struct hv_ring_buffer_debug_info *debug_info) { u32 bytes_avail_towrite; u32 bytes_avail_toread; =20 - if (ring_info->ring_buffer) { - hv_get_ringbuffer_availbytes(ring_info, - &bytes_avail_toread, - &bytes_avail_towrite); - - debug_info->bytes_avail_toread =3D bytes_avail_toread; - debug_info->bytes_avail_towrite =3D bytes_avail_towrite; - debug_info->current_read_index =3D - ring_info->ring_buffer->read_index; - debug_info->current_write_index =3D - ring_info->ring_buffer->write_index; - debug_info->current_interrupt_mask =3D - ring_info->ring_buffer->interrupt_mask; - } + if (!ring_info->ring_buffer) + return -EINVAL; + + hv_get_ringbuffer_availbytes(ring_info, + &bytes_avail_toread, + &bytes_avail_towrite); + debug_info->bytes_avail_toread =3D bytes_avail_toread; + debug_info->bytes_avail_towrite =3D bytes_avail_towrite; + debug_info->current_read_index =3D ring_info->ring_buffer->read_index; + debug_info->current_write_index =3D ring_info->ring_buffer->write_index; + debug_info->current_interrupt_mask + =3D ring_info->ring_buffer->interrupt_mask; + return 0; } EXPORT_SYMBOL_GPL(hv_ringbuffer_get_debuginfo); =20 diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index d0ff656..403fee0 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -313,12 +313,16 @@ static ssize_t out_intr_mask_show(struct device *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info outbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, + &outbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", outbound.current_interrupt_mask); } static DEVICE_ATTR_RO(out_intr_mask); @@ -328,12 +332,15 @@ static ssize_t out_read_index_show(struct device *dev= , { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info outbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, + &outbound); + if (ret < 0) + return ret; return sprintf(buf, "%d\n", outbound.current_read_index); } static DEVICE_ATTR_RO(out_read_index); @@ -344,12 +351,15 @@ static ssize_t out_write_index_show(struct device *de= v, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info outbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, + &outbound); + if (ret < 0) + return ret; return sprintf(buf, "%d\n", outbound.current_write_index); } static DEVICE_ATTR_RO(out_write_index); @@ -360,12 +370,15 @@ static ssize_t out_read_bytes_avail_show(struct devic= e *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info outbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, + &outbound); + if (ret < 0) + return ret; return sprintf(buf, "%d\n", outbound.bytes_avail_toread); } static DEVICE_ATTR_RO(out_read_bytes_avail); @@ -376,12 +389,15 @@ static ssize_t out_write_bytes_avail_show(struct devi= ce *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info outbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, + &outbound); + if (ret < 0) + return ret; return sprintf(buf, "%d\n", outbound.bytes_avail_towrite); } static DEVICE_ATTR_RO(out_write_bytes_avail); @@ -391,12 +407,15 @@ static ssize_t in_intr_mask_show(struct device *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info inbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", inbound.current_interrupt_mask); } static DEVICE_ATTR_RO(in_intr_mask); @@ -406,12 +425,15 @@ static ssize_t in_read_index_show(struct device *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info inbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", inbound.current_read_index); } static DEVICE_ATTR_RO(in_read_index); @@ -421,12 +443,15 @@ static ssize_t in_write_index_show(struct device *dev= , { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info inbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", inbound.current_write_index); } static DEVICE_ATTR_RO(in_write_index); @@ -437,12 +462,15 @@ static ssize_t in_read_bytes_avail_show(struct device= *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info inbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", inbound.bytes_avail_toread); } static DEVICE_ATTR_RO(in_read_bytes_avail); @@ -453,12 +481,15 @@ static ssize_t in_write_bytes_avail_show(struct devic= e *dev, { struct hv_device *hv_dev =3D device_to_hv_device(dev); struct hv_ring_buffer_debug_info inbound; + int ret; =20 if (!hv_dev->channel) return -ENODEV; - if (hv_dev->channel->state !=3D CHANNEL_OPENED_STATE) - return -EINVAL; - hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + + ret =3D hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); + if (ret < 0) + return ret; + return sprintf(buf, "%d\n", inbound.bytes_avail_towrite); } static DEVICE_ATTR_RO(in_write_bytes_avail); diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 14131b6..ed74888 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -1176,8 +1176,9 @@ struct hv_ring_buffer_debug_info { u32 bytes_avail_towrite; }; =20 -void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_in= fo, - struct hv_ring_buffer_debug_info *debug_info); + +int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_inf= o, + struct hv_ring_buffer_debug_info *debug_info); =20 /* Vmbus interface */ #define vmbus_driver_register(driver) \ --=20 2.7.4