RDMA/nes: Fix off-by-one
authorAdrian Bunk <bunk@kernel.org>
Thu, 21 Feb 2008 14:01:18 +0000 (08:01 -0600)
committerRoland Dreier <rolandd@cisco.com>
Tue, 26 Feb 2008 00:00:30 +0000 (16:00 -0800)
Fix an off-by-one spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Glenn Streiff <gstreiff@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/nes/nes_verbs.c

index 201b95ee23cb4033b0ff5db62b9fa720de8956cb..692f0d821301c99c169eb9232146820925e57540 100644 (file)
@@ -929,7 +929,7 @@ static struct ib_pd *nes_alloc_pd(struct ib_device *ibdev,
                                NES_MAX_USER_DB_REGIONS, nesucontext->first_free_db);
                nes_debug(NES_DBG_PD, "find_first_zero_biton doorbells returned %u, mapping pd_id %u.\n",
                                nespd->mmap_db_index, nespd->pd_id);
-               if (nespd->mmap_db_index > NES_MAX_USER_DB_REGIONS) {
+               if (nespd->mmap_db_index >= NES_MAX_USER_DB_REGIONS) {
                        nes_debug(NES_DBG_PD, "mmap_db_index > MAX\n");
                        nes_free_resource(nesadapter, nesadapter->allocated_pds, pd_num);
                        kfree(nespd);