pvrdma: check return value from pvrdma_idx_ring_has_ routines
commitf1e2e38ee0136b7710a2caa347049818afd57a1b
authorPrasad J Pandit <pjp@fedoraproject.org>
Wed, 12 Dec 2018 19:30:39 +0000 (13 01:00 +0530)
committerMarcel Apfelbaum <marcel.apfelbaum@gmail.com>
Sat, 22 Dec 2018 09:09:57 +0000 (22 11:09 +0200)
tree49042b31975582c51c2e6691c120c78575d1a85e
parent7be3a21325e95e3f0bb46d1a67d5fc702b24701f
pvrdma: check return value from pvrdma_idx_ring_has_ routines

pvrdma_idx_ring_has_[data/space] routines also return invalid
index PVRDMA_INVALID_IDX[=-1], if ring has no data/space. Check
return value from these routines to avoid plausible infinite loops.

Reported-by: Li Qiang <liq3ea@163.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
hw/rdma/vmw/pvrdma_dev_ring.c