There's some other allocations but they're not so trivial as they use
kmemdup() and kstrdup().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
struct gpio_regulator_data *drvdata;
int ptr, ret, state;
- drvdata = kzalloc(sizeof(struct gpio_regulator_data), GFP_KERNEL);
+ drvdata = devm_kzalloc(&pdev->dev, sizeof(struct gpio_regulator_data),
+ GFP_KERNEL);
if (drvdata == NULL) {
dev_err(&pdev->dev, "Failed to allocate device data\n");
return -ENOMEM;
err_name:
kfree(drvdata->desc.name);
err:
- kfree(drvdata);
return ret;
}
gpio_free(drvdata->enable_gpio);
kfree(drvdata->desc.name);
- kfree(drvdata);
return 0;
}