1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

hyperv/vmbus: Stringent GPADL parameter assertion.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8632
This commit is contained in:
Sepherosa Ziehau 2016-11-28 07:04:32 +00:00
parent fa643a5d0a
commit 6555f01eec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309237

View File

@ -502,11 +502,7 @@ vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr,
int page_count, range_len, i, cnt, error;
uint64_t page_id;
/*
* Reset GPADL, so that the result would consistent, if error
* happened later on.
*/
*gpadl0 = 0;
KASSERT(*gpadl0 == 0, ("GPADL is not zero"));
/*
* Preliminary checks.
@ -652,6 +648,8 @@ vmbus_chan_gpadl_disconnect(struct vmbus_channel *chan, uint32_t gpadl)
struct vmbus_chanmsg_gpadl_disconn *req;
int error;
KASSERT(gpadl != 0, ("GPADL is zero"));
mh = vmbus_msghc_get(sc, sizeof(*req));
if (mh == NULL) {
vmbus_chan_printf(chan,