Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Sep 2016 06:30:14 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305789 - head/sys/dev/hyperv/vmbus
Message-ID:  <201609140630.u8E6UEIU073816@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Sep 14 06:30:14 2016
New Revision: 305789
URL: https://svnweb.freebsd.org/changeset/base/305789

Log:
  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

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_chan.c

Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c	Wed Sep 14 06:15:45 2016	(r305788)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c	Wed Sep 14 06:30:14 2016	(r305789)
@@ -1346,6 +1346,8 @@ vmbus_subchan_get(struct vmbus_channel *
 	struct vmbus_channel **ret, *chan;
 	int i;
 
+	KASSERT(subchan_cnt > 0, ("invalid sub-channel count %d", subchan_cnt));
+
 	ret = malloc(subchan_cnt * sizeof(struct vmbus_channel *), M_TEMP,
 	    M_WAITOK);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609140630.u8E6UEIU073816>