Author: sephe
Date: Thu Oct 13 08:50:18 2016
New Revision: 307207
URL: https://svnweb.freebsd.org/changeset/base/307207

Log:
  MFC 305789
  
      hyperv/vmbus: Make sure that the sub-channel count is valid.
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D7865

Modified:
  stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c
==============================================================================
--- stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Oct 13 08:47:51 2016        
(r307206)
+++ stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Thu Oct 13 08:50:18 2016        
(r307207)
@@ -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);
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to