mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: soc-ac97: Fix error handling in snd_soc_new_ac97_component()
If call to snd_soc_ac97_init_gpio() fails, proper removal procedure
should mirror snd_soc_free_ac97_component() behaviour and call
device_del() before put_device().
Fixes: 9bf5c3d11f ("ASoC: ac97: add gpio chip")
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Link: https://patch.msgid.link/20261014200608.118770-6-amade@asmblr.net
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
77dfd98b16
commit
fc081cdfc6
|
|
@ -241,10 +241,12 @@ struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
|
|||
|
||||
ret = snd_soc_ac97_init_gpio(ac97, component);
|
||||
if (ret)
|
||||
goto err_put_device;
|
||||
goto err_del_device;
|
||||
|
||||
return ac97;
|
||||
|
||||
err_del_device:
|
||||
device_del(&ac97->dev);
|
||||
err_put_device:
|
||||
put_device(&ac97->dev);
|
||||
return ERR_PTR(ret);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user