[rtems commit] leon, grspw_pkt: fix overwrite protection when more than 32 devs

Daniel Hellstrom danielh at rtems.org
Mon Mar 6 06:58:44 UTC 2017


Module:    rtems
Branch:    master
Commit:    49caf2222636df5166ff7033bec1054b9b3885ce
Changeset: http://git.rtems.org/rtems/commit/?id=49caf2222636df5166ff7033bec1054b9b3885ce

Author:    Daniel Hellstrom <daniel at gaisler.com>
Date:      Fri Feb  3 08:55:27 2017 +0100

leon, grspw_pkt: fix overwrite protection when more than 32 devs

This is a fix for a coverity warning

---

 c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
index e1568a1..b7b3624 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c
@@ -3093,7 +3093,7 @@ static int grspw2_init3(struct drvmgr_dev *dev)
 	GRSPW_DBG("GRSPW[%d] on bus %s\n", dev->minor_drv,
 		dev->parent->dev->name);
 
-	if (grspw_count > GRSPW_MAX)
+	if (grspw_count >= GRSPW_MAX)
 		return DRVMGR_ENORES;
 
 	priv = dev->priv;



More information about the vc mailing list