From patchwork Fri Oct 25 09:06:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3094621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C6249F2B8 for ; Fri, 25 Oct 2013 09:07:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A5B720251 for ; Fri, 25 Oct 2013 09:07:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CE61920218 for ; Fri, 25 Oct 2013 09:07:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VZdM7-0007Qx-Ks; Fri, 25 Oct 2013 09:06:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VZdM5-0006IE-6a; Fri, 25 Oct 2013 09:06:53 +0000 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VZdM0-0006Hs-Qy for linux-arm-kernel@lists.infradead.org; Fri, 25 Oct 2013 09:06:51 +0000 Received: by mail-ee0-f52.google.com with SMTP id d51so1761155eek.39 for ; Fri, 25 Oct 2013 02:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=JgXks263QAJLk0iOUi5kl7AWo8m4TVZTm3E0F2Sao44=; b=rTGd3kbSrNaoar8T5hNMMN1Hzc9WbCZoXYCXKbx33L8gWQV1Pny/vAZw7FMrbDCtht DSSDAChT4xOpF8qZUvNnkmwjWyhbLGcnb8h/nUdTb/aRkP5st+gVdI2vLsDTkiw+C3ER zP7/A7vWtsr8BoxGK65Zs8POUTuNKLDCo4pf2FjbasLTSBSxZXRGg9IE2Zl7AQgwNnke BZJ1xq0/efzMjupb0s3t1btn2YDNkg80bKa34U/bpKKaDgMmBy431pPTmvzTfQJNDBu2 Eyn4BJsfql3kj2lYMtJRa7xQt4xYkZQZTQVqwE+opxHyF38K9R3h2aZaWkeYfBCJyuXo gC2g== MIME-Version: 1.0 X-Received: by 10.204.105.198 with SMTP id u6mr3182170bko.19.1382691984981; Fri, 25 Oct 2013 02:06:24 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Fri, 25 Oct 2013 02:06:24 -0700 (PDT) Date: Fri, 25 Oct 2013 17:06:24 +0800 Message-ID: Subject: [PATCH] ASoC: Samsung: I2S: fix return value check in i2s_alloc_dai() From: Wei Yongjun To: ben-linux@fluff.org, kgene.kim@samsung.com, sbkim73@samsung.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.de, grant.likely@linaro.org, rob.herring@calxeda.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131025_050648_997238_3F0644C9 X-CRM114-Status: GOOD ( 11.29 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, linux-samsung-soc@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function platform_device_alloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- sound/soc/samsung/i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index b302f3b..b721443 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1073,7 +1073,7 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec) dev_set_drvdata(&i2s->pdev->dev, i2s); } else { /* Create a new platform_device for Secondary */ i2s->pdev = platform_device_alloc("samsung-i2s-sec", -1); - if (IS_ERR(i2s->pdev)) + if (!i2s->pdev) return NULL; i2s->pdev->dev.parent = &pdev->dev;