From patchwork Fri Jul 17 01:42:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernelpatch_update X-Patchwork-Id: 6816131 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07406C05AC for ; Fri, 17 Jul 2015 14:11:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3194D20778 for ; Fri, 17 Jul 2015 14:11:10 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 045282060B for ; Fri, 17 Jul 2015 14:11:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1CC06266964; Fri, 17 Jul 2015 16:11:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 0592B26067B; Fri, 17 Jul 2015 16:10:03 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3EA8726062F; Fri, 17 Jul 2015 04:01:59 +0200 (CEST) Received: from m12-17.163.com (m12-17.163.com [220.181.12.17]) by alsa0.perex.cz (Postfix) with ESMTP id 4880F260629 for ; Fri, 17 Jul 2015 04:01:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=CiQd4aQ5BjSaSat78p 0Nq+N/M/tS7fhz4l/wVXbhVMk=; b=JsSQcTmlpIjwiAfpf0NsSRxsGcC+e3d36z 9A4C7zZdP4BPfsWCI4pZ+6aiBFGaJhIVP6IpJzvGn3rINb5dlXVneYDEjc1JK1yh ijJlrKuW3iUHRu7SgncGZcGnp40TA6mbfSo6DdnNv1RKmDfIqZ5X6lZ3Ec71cq0Z Ew7038AAg= Received: from localhost (unknown [124.16.141.104]) by smtp13 (Coremail) with SMTP id EcCowAAHW1hyXahVKLwlAA--.6465S2; Fri, 17 Jul 2015 09:42:12 +0800 (CST) From: Heloise NH To: perex@perex.cz, tiwai@suse.de, david.henningsson@canonical.com, pshou@realtek.com, hui.wang@canonical.com Date: Fri, 17 Jul 2015 09:42:06 +0800 Message-Id: <1437097326-470-1-git-send-email-kernelpatch_update@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: EcCowAAHW1hyXahVKLwlAA--.6465S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrurWfZr1UXF1UAFW3Zw15XFb_yoW3twc_Xw 48KrWkWa1qqFn7Can5KrnYy3WSg34rCry0grnrtF4UAFs5tr48Wr98Ja15uFZrXFn2kry3 ur1DA3yq9r43AjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUboGQPUUUUU== X-Originating-IP: [124.16.141.104] X-CM-SenderInfo: xnhu0vxosd3uhkbx1vxdwhqiywtou0bp/xtbBLRc6glO-vCIfmwAAs0 X-Mailman-Approved-At: Fri, 17 Jul 2015 16:10:00 +0200 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernelpatch_update Subject: [alsa-devel] [PATCH] ALSA: hda: fix kstrdup return value X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: 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: Heloise NH --- 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; } }