From patchwork Fri Sep 21 06:32:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489731 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 975A9DF28C for ; Fri, 21 Sep 2012 06:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337Ab2IUGcG (ORCPT ); Fri, 21 Sep 2012 02:32:06 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:45581 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440Ab2IUGcF (ORCPT ); Fri, 21 Sep 2012 02:32:05 -0400 Received: by qaas11 with SMTP id s11so1011943qaa.19 for ; Thu, 20 Sep 2012 23:32:04 -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=Pe7XV+qZsPWsCW1TdBRTxKdj7jgryJ7efnlG61OkcHo=; b=l8qD0RE83SZ3WlIcleJmLeeT0eKQl+VhWHORuDAiJBPbRRUobTBVg0PHLjPnevVetK Zg/t/TxWgyEgtQPkBuY5ZW2+e7knSPA1oKPdQTVSu8C7EMFCfLEKVY3Q92A51js+BZpf /RmHAcnv4/2Mv95MpPMNj2j35kcMSP6Urxk8y3fRqC1LxTcp9QPDV9jOqpAZpZ3aLMke Aatb5+ZAgdoicSM2kIEE5/zbm4vGsimRCkNeUXZgysHg4CL0w0QzV6i2UMx1Q3/crkjm ejIk2VJOCjuWn9p39HhOM/sB3Chvw2OnyyfGgL0b1DwwTCO7EsssAfzrStU3yOseTlbJ /+0g== MIME-Version: 1.0 Received: by 10.229.136.200 with SMTP id s8mr2755795qct.46.1348209124377; Thu, 20 Sep 2012 23:32:04 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:32:04 -0700 (PDT) Date: Fri, 21 Sep 2012 14:32:04 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: omap_device: fix return value check in omap_device_build_ss() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk, grant.likely@secretlab.ca, rob.herring@calxeda.com Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Wei Yongjun In case of error, the function omap_device_alloc() returns ERR_PTR() and never returns NULL pointer. The NULL test in the return value check should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Acked-by: Kevin Hilman --- arch/arm/plat-omap/omap_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index c490240..3f62de6 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -671,7 +671,7 @@ struct platform_device __init *omap_device_build_ss(const char *pdev_name, int p dev_set_name(&pdev->dev, "%s", pdev->name); od = omap_device_alloc(pdev, ohs, oh_cnt, pm_lats, pm_lats_cnt); - if (!od) + if (IS_ERR(od)) goto odbs_exit1; ret = platform_device_add_data(pdev, pdata, pdata_len);