diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9558125b448da040205249a51ff9793b9577e2de..8b1ef90f7b576577b98781f86f2f7d4b9fc83d80 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3454,7 +3454,6 @@ int snd_soc_add_component(struct device *dev, err_cleanup: snd_soc_component_cleanup(component); err_free: - kfree(component); return ret; } EXPORT_SYMBOL_GPL(snd_soc_add_component); @@ -3466,7 +3465,7 @@ int snd_soc_register_component(struct device *dev, { struct snd_soc_component *component; - component = kzalloc(sizeof(*component), GFP_KERNEL); + component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); if (!component) return -ENOMEM; @@ -3501,7 +3500,6 @@ static int __snd_soc_unregister_component(struct device *dev) if (found) { snd_soc_component_cleanup(component); - kfree(component); } return found;