All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heloise NH <kernelpatch_update@163.com>
To: perex@perex.cz, tiwai@suse.de, david.henningsson@canonical.com,
	pshou@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: Fri, 17 Jul 2015 09:42:06 +0800	[thread overview]
Message-ID: <1437097326-470-1-git-send-email-kernelpatch_update@163.com> (raw)

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

             reply	other threads:[~2015-07-17  1:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-17  1:42 Heloise NH [this message]
2015-07-17 12:56 ` [PATCH] ALSA: hda: fix kstrdup return value 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

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=1437097326-470-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=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pshou@realtek.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.