On Wed, Mar 16, 2022 at 11:39:48AM +0300, Dan Carpenter wrote: > This code checks "index" for an upper bound but it does not check for > negatives. Change the type to unsigned to prevent underflows. > > Fixes: 3c3c1f141639 ("RDMA/nldev: Allow optional-counter status configuration through RDMA netlink") > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx> > --- > Could we not use a nldev_policy[] to tighten the bounds checking even > more? > > drivers/infiniband/core/nldev.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Applied to for-next, thanks Jason