validation: queue: avoid out of bounds references
validation: queue: avoid out of bounds references

Resolve Bug https://bugs.linaro.org/show_bug.cgi?id=2377 by correcting
loop bounds for error case.

Signed-off-by: Bill Fischofer <52f3c909d51cc5d355a68a403df6906b3c1a8f83@linaro.org>
Reviewed-by: Petri Savolainen <d528fd253b9aaf78fa72edbcc6249e82047f6ce6@nokia.com>
Signed-off-by: Maxim Uvarov <db4d16e02ae2d7493db430203537da8b2e34f290@linaro.org>

ravineet-singh/odp,nmorey/odp,dkrot/odp,erachmi/odp,dkrot/odp,mike-holmes-linaro/odp,dkrot/odp,nmorey/odp,ravineet-singh/odp,mike-holmes-linaro/odp,mike-holmes-linaro/odp,nmorey/odp,mike-holmes-linaro/odp,erachmi/odp,erachmi/odp,nmorey/odp,dkrot/odp,ravineet-singh/odp,erachmi/odp,ravineet-singh/odp