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
This commit is contained in:
araujo 2018-05-15 05:55:29 +00:00
parent 7f975ee936
commit 77342f68c6

View File

@ -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);