summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2018-12-17 20:16:09 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-31 08:13:44 +0100
commitbe0cb9e226b7c594070eb64ef8c18f3793f63976 (patch)
tree3ecbb8a9898cceee08570f7349104616de383ff4 /include
parenta28dc8a5686a1641934f66b2a09c68a804810fe5 (diff)
downloadlinux-rpi3-be0cb9e226b7c594070eb64ef8c18f3793f63976.tar.gz
linux-rpi3-be0cb9e226b7c594070eb64ef8c18f3793f63976.tar.bz2
linux-rpi3-be0cb9e226b7c594070eb64ef8c18f3793f63976.zip
Drivers: hv: vmbus: Check for ring when getting debug info
commit ba50bf1ce9a51fc97db58b96d01306aa70bc3979 upstream. 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 <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Dexuan Cui <decui@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hyperv.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index d1324d3c72b0..8d3ca6da3342 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1130,8 +1130,9 @@ struct hv_ring_buffer_debug_info {
u32 bytes_avail_towrite;
};
-void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
- struct hv_ring_buffer_debug_info *debug_info);
+
+int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
+ struct hv_ring_buffer_debug_info *debug_info);
/* Vmbus interface */
#define vmbus_driver_register(driver) \