Skip to contentSkip to conversation

ALSA: hda: fix kstrdup return value

PATCH Applied Heloise NH 2 participants 2 messages Jul 17, 2015 Sound

lore
Share & tools
lore

Heloise NH

author
#0 lore raw

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.

---
 sound/pci/hda/hda_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
index 5de3c5d..d78fa71 100644
@@ -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
Applied
#1 lore raw
Quoted 8 lines · Heloise NH

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.

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
index 5de3c5d..d78fa71 100644
@@ -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