remoteproc: off by one in rproc_virtio_new_vringh()
Subsystems (2)
PATCH 1/1 remoteproc: off by one in rproc_virtio_new_vringh()
It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() because it is an index.
Signed-off-by Dan Carpenter <[email protected]>
drivers/remoteproc/remoteproc_virtio.c +1 -1
@@ -208,7 +208,7 @@ rproc_virtio_new_vringh(struct virtio_device *vdev, unsigned index,struct vringh *vrh;int err; -if (index >ARRAY_SIZE (rvdev->vring)) { +if (index >=ARRAY_SIZE (rvdev->vring)) {dev_err (&rvdev->vdev.dev,"bad vring index: %d\n" , index);return NULL ; }