ALSA: hda: fix kstrdup return value
PATCH 1/1 ALSA: hda: fix kstrdup return value
From: kernelpatch_update <[email protected]>
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 <[email protected]>
--- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
@@ -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; } }
Signature · 1 line
1.9.1
Takashi Iwai
AppliedQuoted 8 lines · Heloise NH
From:
kernelpatch_update<[email protected]>In kstrdup we should return
-ENOMEMwhen it reports an memory allocation failure, while the-ENODEVis referred to a failure in finding the cpu node in the device tree.Signed-off-by Heloise NH <[email protected]>
Thanks, applied.
Takashi
Quoted 21 lines
--- sound/pci/hda/hda_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/pci/hda/hda_codec.c +1
-1@@ -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; } }Signature · 1 line
1.9.1