Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2018 05:55:29 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333622 - head/usr.sbin/bhyve
Message-ID:  <201805150555.w4F5tTaU033570@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Tue May 15 05:55:29 2018
New Revision: 333622
URL: https://svnweb.freebsd.org/changeset/base/333622

Log:
  vq_getchain() can return -1 if some descriptor(s) are invalid and prints
  a diagnostic message. So we do a sanity checking on the return value
  of vq_getchain().
  
  Spotted by:	gcc49
  Reviewed by:	avg
  MFC after:	4 weeks
  Sponsored by:	iXsystems Inc.
  Differential Revision:	https://reviews.freebsd.org/D15388

Modified:
  head/usr.sbin/bhyve/pci_virtio_console.c

Modified: head/usr.sbin/bhyve/pci_virtio_console.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_console.c	Tue May 15 04:31:11 2018	(r333621)
+++ head/usr.sbin/bhyve/pci_virtio_console.c	Tue May 15 05:55:29 2018	(r333622)
@@ -579,6 +579,7 @@ pci_vtcon_notify_tx(void *vsc, struct vqueue_info *vq)
 
 	while (vq_has_descs(vq)) {
 		n = vq_getchain(vq, &idx, iov, 1, flags);
+		assert(n >= 1);
 		if (port != NULL)
 			port->vsp_cb(port, port->vsp_arg, iov, 1);
 



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