public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda: fix kstrdup return value
@ 2015-07-17  1:42 Heloise NH
  2015-07-17 12:56 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Heloise NH @ 2015-07-17  1:42 UTC (permalink / raw)
  To: perex, tiwai, david.henningsson, pshou, hui.wang
  Cc: alsa-devel, linux-kernel, kernelpatch_update

From: kernelpatch_update <kernelpatch_update@163.com>

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 <kernelpatch_update@163.com>
---
 sound/pci/hda/hda_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5de3c5d..d78fa71 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;
 		}
 	}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [PATCH] ALSA: hda: fix kstrdup return value
@ 2015-07-16  1:04 kernelpatch_update
  2015-07-16 10:27 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: kernelpatch_update @ 2015-07-16  1:04 UTC (permalink / raw)
  To: perex, tiwai, david.henningsson, kailang, hui.wang
  Cc: alsa-devel, linux-kernel, kernelpatch_update

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: kernelpatch_update <kernelpatch_update@163.com>
---
 sound/pci/hda/hda_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5de3c5d..d78fa71 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;
 		}
 	}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-17 12:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17  1:42 [PATCH] ALSA: hda: fix kstrdup return value Heloise NH
2015-07-17 12:56 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2015-07-16  1:04 kernelpatch_update
2015-07-16 10:27 ` Takashi Iwai
2015-07-16 10:28   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox