@@ -1599,6 +1599,7 @@ static int keembay_add_functions(struct keembay_pinctrl *kpc,
static int keembay_build_functions(struct keembay_pinctrl *kpc)
{
struct function_desc *keembay_funcs, *new_funcs;
+ int err;
int i;
/*
@@ -1643,7 +1644,11 @@ static int keembay_build_functions(struct keembay_pinctrl *kpc)
return -ENOMEM;
}
- return keembay_add_functions(kpc, new_funcs);
+ err = keembay_add_functions(kpc, new_funcs);
+
+ kfree(new_funcs);
+
+ return err;
}
static const struct keembay_pin_soc keembay_data = {