public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] remoteproc: off by one in rproc_virtio_new_vringh()
@ 2013-02-22  6:05 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-02-22  6:05 UTC (permalink / raw)
  To: Ohad Ben-Cohen; +Cc: open list, kernel-janitors

It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE() because it
is an index.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index dba33ff..b5e3af5 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -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;
 	}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-22  6:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22  6:05 [patch] remoteproc: off by one in rproc_virtio_new_vringh() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox