From patchwork Wed Sep 20 10:06:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9961251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 744C8601D5 for ; Wed, 20 Sep 2017 10:08:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65E0C28868 for ; Wed, 20 Sep 2017 10:08:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A9FD28875; Wed, 20 Sep 2017 10:08:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A19DD28868 for ; Wed, 20 Sep 2017 10:08:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2D088267484; Wed, 20 Sep 2017 12:07:26 +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 0A66E26745B; Wed, 20 Sep 2017 12:07:25 +0200 (CEST) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by alsa0.perex.cz (Postfix) with ESMTP id 276892668BF for ; Wed, 20 Sep 2017 12:07:22 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id i23so1018798pfi.2 for ; Wed, 20 Sep 2017 03:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/nd4Bcbi9Si/JaazsPgxcC9DBBCBrluZSxBiO7JSZBc=; b=YinqttXj3Xjg5Elfd8+RkCEUcWSXGQXw/iAmlVmqfT1A4HXU0as/4W4LXFVysAbuSm R1WGrqnCoAciDz122is/HbqCaHDWvaUYTmL64koG9yFKz9BXeksi+bhHFJel9N/1J+91 uYtAcLlBcTnZ711I1hALr77Yb4nf7r5edcI4PtQW+gkezYRwdW6T0TsNB93/Bp/I7v/W VUjZIyZCofYanHl1704JUjdtzSh8BBJ/FuSG1Q0h0cLfC4kWbXzhC5aoxtmzPY9Se2PU qXX1P7kEPQY5gPfkICn4v0ujVUyaTRKrwdRnRmmzHdTpNujoutIMs4stCbbLnnOlYsDc F94g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/nd4Bcbi9Si/JaazsPgxcC9DBBCBrluZSxBiO7JSZBc=; b=VpbyNilF/ADYl4xZBnNtc/EFafwdn6+puyXpjgv5cGI9+OcD/GNrM1+c3UVmjXN4G4 tozVfg7og90XsvNKrdLUhhU0KDePwaliR756YkLBU30F5tC0dG0AbGdCLdJTx2a/mWcY zmpR2/S36rjSJuYQKUfMbaxSLHZu91IG2uJvt+yCQovHwcDze0D1EgC24yYN/rqquQ2V o2gu+o6mbCgAvx5v0QtpzcQoUymGaaxF10iRw4dWsK9EcQ/TWLiTkVBGn6IyKJX8d1cS ifxy2qM+zZPjU4bi17VbtWkRCGV4UGO2wznRsnauU0sGqV9Ix0hderXpiyLCdObW/USd Z43w== X-Gm-Message-State: AHPjjUi8Dm02fTNWNDfyfSgqTXqnKTZ7Ag06w3v88AuUp85lTUIuIcWE Bygcrf8Ore7MGNYu1NSS5nsYFQHy X-Google-Smtp-Source: AOwi7QCwJI9QiY48NdPWrD8e4a+2bOKCOQ5gy7TkmKoBaRq6ow0ctjOKIGhnRL44ZtVBXAsAG1gFyQ== X-Received: by 10.98.245.206 with SMTP id b75mr1640482pfm.130.1505902042042; Wed, 20 Sep 2017 03:07:22 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id u12sm10492250pfg.146.2017.09.20.03.07.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Sep 2017 03:07:21 -0700 (PDT) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, timur@tabi.org, nicoleotsuka@gmail.com, Xiubo.Lee@gmail.com, fabio.estevam@nxp.com, peter.ujfalusi@ti.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Wed, 20 Sep 2017 15:36:11 +0530 Message-Id: <1505901971-12004-4-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505901971-12004-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1505901971-12004-1-git-send-email-arvind.yadav.cs@gmail.com> Cc: linux-omap@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH 3/3] ASoC: omap-hdmi-audio: Handle return value of devm_kasprintf 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 devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- sound/soc/omap/omap-hdmi-audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c index 3e9cc48..8eeac7c 100644 --- a/sound/soc/omap/omap-hdmi-audio.c +++ b/sound/soc/omap/omap-hdmi-audio.c @@ -362,6 +362,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev) card->name = devm_kasprintf(dev, GFP_KERNEL, "HDMI %s", dev_name(ad->dssdev)); + if (!card->name) + return -ENOMEM; + card->owner = THIS_MODULE; card->dai_link = devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL);