From patchwork Tue Mar 3 13:29:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Thanki X-Patchwork-Id: 5922791 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC8B99F318 for ; Tue, 3 Mar 2015 13:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0071020154 for ; Tue, 3 Mar 2015 13:29:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B6A1C2013D for ; Tue, 3 Mar 2015 13:29:26 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8AC2826152C; Tue, 3 Mar 2015 14:29:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 7AC372614C2; Tue, 3 Mar 2015 14:29:17 +0100 (CET) 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 3D1C8261501; Tue, 3 Mar 2015 14:29:16 +0100 (CET) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by alsa0.perex.cz (Postfix) with ESMTP id 3B6E52614A9 for ; Tue, 3 Mar 2015 14:29:09 +0100 (CET) Received: by pablj1 with SMTP id lj1so14880255pab.10 for ; Tue, 03 Mar 2015 05:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=UGZS3x4KPqWSaYcRiv4fLgDYpQMquQkt9XhCMiLGStM=; b=VThM8qyFncE3GZkjvA1HvHMa+phg0uogeEMu4Jpw3fWDFixdVkFX2mEY7GdQj5dTus EjeJVfhH4Z3uW0rjBNdVEmM0znxHQxBlq6oRff/NiJqtJ4qtpedO++ceoe5KjSPbtpmD vHNYjrTug093UGrum4+X8xNjyh75isWylWseQimTOOiCc17ngtcUdW/prytt0w81ewxO OD7GZBlBAXVGzMt6YreqegpQleTMJgM5VoZHAFX0fRAIaK5msO5AmW+dIPH4KCC7bD0b oUrh3w0c2T0AeL37PJNM3vZFQsRXHVN1MGw2MC2mxAPQTXBfT0DYPCzSP6wUW/wl7Vp4 iGGw== X-Received: by 10.70.94.195 with SMTP id de3mr54840795pdb.59.1425389347513; Tue, 03 Mar 2015 05:29:07 -0800 (PST) Received: from vishal ([202.131.115.146]) by mx.google.com with ESMTPSA id hl2sm1050455pdb.43.2015.03.03.05.29.05 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Mar 2015 05:29:06 -0800 (PST) Date: Tue, 3 Mar 2015 18:59:00 +0530 From: Vishal Thanki To: kernel-janitors@vger.kernel.org, alsa-devel@alsa-project.org, broonie@kernel.org, lgirdwood@gmail.com Message-ID: <20150303132900.GA22246@vishal> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [alsa-devel] [PATCH] ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Make sure devm_kzalloc() succeeds. Signed-off-by: Vishal Thanki --- sound/soc/generic/simple-card.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index f7c6734..fb550b5 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, strlen(dai_link->cpu_dai_name) + strlen(dai_link->codec_dai_name) + 2, GFP_KERNEL); + if (!name) { + ret = -ENOMEM; + goto dai_link_of_err; + } + sprintf(name, "%s-%s", dai_link->cpu_dai_name, dai_link->codec_dai_name); dai_link->name = dai_link->stream_name = name;