On Wed, Oct 12, 2016 at 02:36:16PM +0200, Johannes Thumshirn wrote: > +void berlin_pinctrl_free_funcgroups(struct berlin_pinctrl *pctrl) > +{ > + struct berlin_desc_group const *desc_group; > + struct berlin_desc_function const *desc_function; > + int i; > + > + for (i = 0; i < pctrl->desc->ngroups; i++) { > + desc_group = pctrl->desc->groups + i; > + desc_function = desc_group->functions; > + > + while (desc_function->name) { > + struct berlin_pinctrl_function > + *function = pctrl->functions; > + > + kfree(function->groups); It looks like, we're just freeing pctrl->functions->groups over and over. Not taking advantage of managed allocations has made this stuff so much more complicated. I'd be tempted almost to just delete the krealloc() and waste a little RAM... (I have no idea how much RAM I'm talking about here so maybe this is a bad idea). > + desc_function++; > + } > + } > +} > -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html