From: Heloise NH Date: Fri, 17 Jul 2015 01:42:06 +0000 (+0800) Subject: ALSA: hda: fix kstrdup return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6986a0e2556df3dfb54c624b50b02936bd1e00ef;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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: Heloise NH Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 5de3c5d8c2c0..d78fa713c103 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -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; } }