On 08/18/2015 05:23 AM, Dan Carpenter wrote: > This is a zero offset array. The current code could try to free random > memory and crash. Also it leaks the first element. > > Fixes: 230145ff8124 ('IB/core: Add RoCE GID table management') > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> This one, however, was not needed after Matan's fixup series was applied. > diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c > index a9d5c70..f5d14a7 100644 > --- a/drivers/infiniband/core/cache.c > +++ b/drivers/infiniband/core/cache.c > @@ -582,7 +582,7 @@ static int _gid_table_setup_one(struct ib_device *ib_dev) > return 0; > > rollback_table_setup: > - for (port = 1; port <= ib_dev->phys_port_cnt; port++) > + for (port = 0; port < ib_dev->phys_port_cnt; port++) > free_gid_table(ib_dev, port, table[port]); > > kfree(table); > -- Doug Ledford <dledford@xxxxxxxxxx> GPG KeyID: 0E572FDD
Attachment:
signature.asc
Description: OpenPGP digital signature