examples/ioat: handle failure case for ioat dequeue
authorBruce Richardson <bruce.richardson@intel.com>
Mon, 25 Nov 2019 15:23:03 +0000 (15:23 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 26 Nov 2019 16:26:08 +0000 (17:26 +0100)
commit92c981637ffcc785026f14edb886a94f46315e22
tree5f46d8cc64d7edc27889be5029fcdb63adfe29c7
parent2808a12cc05375e986ee1c9bb956bad8288c2b5a
examples/ioat: handle failure case for ioat dequeue

On a failure with the ioat dequeue, -1 is returned, which was not properly
handled. This could lead to out-of-bounds reads on a later loop which
assumed a positive return value. Fix this by treating an error as though a
dequeue of 0 had been encountered.

Coverity issue: 350342
Coverity issue: 350349
Fixes: 2328542ed84e ("examples/ioat: add rawdev copy mode")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
examples/ioat/ioatfwd.c