hyperv/vmbus: Make sure that the sub-channel count is valid.
MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7865
This commit is contained in:
parent
098ab4a242
commit
67e44048f0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305789
@ -1346,6 +1346,8 @@ vmbus_subchan_get(struct vmbus_channel *pri_chan, int subchan_cnt)
|
|||||||
struct vmbus_channel **ret, *chan;
|
struct vmbus_channel **ret, *chan;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
KASSERT(subchan_cnt > 0, ("invalid sub-channel count %d", subchan_cnt));
|
||||||
|
|
||||||
ret = malloc(subchan_cnt * sizeof(struct vmbus_channel *), M_TEMP,
|
ret = malloc(subchan_cnt * sizeof(struct vmbus_channel *), M_TEMP,
|
||||||
M_WAITOK);
|
M_WAITOK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user