On Mon, Jun 06, 2016 at 07:53:43PM -0400, Doug Ledford wrote: > On 6/4/2016 8:15 AM, Leon Romanovsky wrote: > > From: Mark Bloch > > > > In a attribute group struct, attrs should point to a NULL > > terminated list. Which means we need to allocate one more > > slot in the array. > > This patch is both right and wrong. You're right with the intent (that > there should be a total of 2 extra entries in the array size, one for > the NULL termination and one for the lifespan entry), but wrong with the > mechanics (unless I've missed something). We already have two extra > entries because sizeof(*hsag) includes our first counter, so just > num_counters is actually enough to NULL terminate the list, and + 1 > gives us lifespan plus a NULL terminate spot. The comment could be > cleaned up to make this more clear though, so I'll do that. Thanks Doug.