Acked-by: Selvin Xavier <selvin.xavier@xxxxxxxxxx> Thanks ! > -----Original Message----- > From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx] > Sent: Monday, February 16, 2015 3:32 PM > To: Roland Dreier > Cc: Sean Hefty; Hal Rosenstock; Devesh Sharma; Selvin Xavier; Mitesh Ahuja; > Yishai Hadas; linux-rdma@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx > Subject: [patch] RDMA/ocrdma: off by one in ocrdma_query_gid() > > The ->sgid_tbl[] array has OCRDMA_MAX_SGID number of elements so this > test is off by one. ->sgid_tbl is allocated in ocrdma_alloc_resources(). > > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c > b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c > index fb8d8c4..18ea619 100644 > --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c > +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c > @@ -53,7 +53,7 @@ int ocrdma_query_gid(struct ib_device *ibdev, u8 port, > > dev = get_ocrdma_dev(ibdev); > memset(sgid, 0, sizeof(*sgid)); > - if (index > OCRDMA_MAX_SGID) > + if (index >= OCRDMA_MAX_SGID) > return -EINVAL; > > memcpy(sgid, &dev->sgid_tbl[index], sizeof(*sgid)); -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html