Commit 6986a0e2 authored by Heloise NH's avatar Heloise NH Committed by Takashi Iwai

ALSA: hda: fix kstrdup return value

In kstrdup we should return -ENOMEM when it reports an
memory allocation failure, while the -ENODEV is referred
to a failure in finding the cpu node in the device tree.
Signed-off-by: default avatarHeloise NH <kernelpatch_update@163.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3ce095c1
......@@ -975,7 +975,7 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
if (codec->bus->modelname) {
codec->modelname = kstrdup(codec->bus->modelname, GFP_KERNEL);
if (!codec->modelname) {
err = -ENODEV;
err = -ENOMEM;
goto error;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment