Message ID | 20200902154229.1440489-1-kai.vehmanen@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | ALSA: hda: release resource when snd_hdac_device_init is failed | expand |
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 3e9e9ac804f6..8d9d37225701 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -109,12 +109,16 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, codec->vendor_id & 0xffff); if (!codec->chip_name) { err = -ENOMEM; - goto error; + goto error_chip; } return 0; + error_chip: + kfree(codec->vendor_name); error: + pm_runtime_put_noidle(&codec->dev); + pm_runtime_set_suspended(&codec->dev); put_device(&codec->dev); return err; }