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:
Marcelo Araujo 2018-05-15 05:55:29 +00:00
parent 36ea2fe3bf
commit bc1019a238
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333622

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