[PATCH 2/3] vmbus: initialize reserved fields in messages
From: kys
Date: Thu Oct 05 2017 - 20:36:27 EST
From: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>
Make sure and initialize reserved fields in messages to host,
rather than passing stack junk.
Signed-off-by: Stephen Hemminger <sthemmin@xxxxxxxxxxxxx>
Signed-off-by: K. Y. Srinivasan <kys@xxxxxxxxxxxxx>
---
drivers/hv/channel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index efd5db743319..9f48f454bde0 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -745,6 +745,7 @@ int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
desc.length8 = (u16)(packetlen_aligned >> 3);
desc.transactionid = requestid;
+ desc.reserved = 0;
desc.rangecount = pagecount;
for (i = 0; i < pagecount; i++) {
@@ -788,6 +789,7 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
desc->dataoffset8 = desc_size >> 3; /* in 8-bytes granularity */
desc->length8 = (u16)(packetlen_aligned >> 3);
desc->transactionid = requestid;
+ desc->reserved = 0;
desc->rangecount = 1;
bufferlist[0].iov_base = desc;
--
2.14.1