public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernelpatch_update <kernelpatch_update@163.com>
To: perex@perex.cz, tiwai@suse.de, david.henningsson@canonical.com,
	kailang@realtek.com, hui.wang@canonical.com
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	kernelpatch_update <kernelpatch_update@163.com>
Subject: [PATCH] ALSA: hda: fix kstrdup return value
Date: Thu, 16 Jul 2015 09:04:10 +0800	[thread overview]
Message-ID: <1437008650-23478-1-git-send-email-kernelpatch_update@163.com> (raw)

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



             reply	other threads:[~2015-07-16  1:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16  1:04 kernelpatch_update [this message]
2015-07-16 10:27 ` [PATCH] ALSA: hda: fix kstrdup return value Takashi Iwai
2015-07-16 10:28   ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2015-07-17  1:42 Heloise NH
2015-07-17 12:56 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437008650-23478-1-git-send-email-kernelpatch_update@163.com \
    --to=kernelpatch_update@163.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=david.henningsson@canonical.com \
    --cc=hui.wang@canonical.com \
    --cc=kailang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox