From patchwork Fri Oct 25 09:31:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3094681 Return-Path: X-Original-To: patchwork-linux-omap@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 BF8CA9F372 for ; Fri, 25 Oct 2013 09:31:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A43132025A for ; Fri, 25 Oct 2013 09:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FAF020254 for ; Fri, 25 Oct 2013 09:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752313Ab3JYJbw (ORCPT ); Fri, 25 Oct 2013 05:31:52 -0400 Received: from mail-ea0-f170.google.com ([209.85.215.170]:48451 "EHLO mail-ea0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967Ab3JYJbw (ORCPT ); Fri, 25 Oct 2013 05:31:52 -0400 Received: by mail-ea0-f170.google.com with SMTP id q10so360458eaj.15 for ; Fri, 25 Oct 2013 02:31:51 -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=HIJ5W/U3wx66XXvYwxiPA13HM7eMBpxANiSaXMn7x0A=; b=h0LINhBd6UcuQqDLHidvJCCgPc/CAvKqCKpcHkPEkIsbyT/c2eHJS1DbEXv3Y7LkPk P2PjCMJmlAaXJotscRIirshjs5Y6cAy93SjDTa+1bfF36T7e/NROhqvaLXlXn8VH7KG0 364p7yW5DmPq4Jjvjeok6RpFvonunbkzFlW7J5SCMyw7k6UJzmvXVdOSTSeRBDXJTc5l vgtjIliZTYlapiVWPl6HkCbwaqZ/fStF8iYKTI53A2tid9p4s5xMKN3c49IVGNEMullm FZ07Cvj/YP53FBr4nH29TcRnu/IS+BO6Rhar2Q4APblfXxahUvGLBAC+zh7kBT088Oms HoeA== MIME-Version: 1.0 X-Received: by 10.205.24.131 with SMTP id re3mr3225488bkb.8.1382693511189; Fri, 25 Oct 2013 02:31:51 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Fri, 25 Oct 2013 02:31:51 -0700 (PDT) Date: Fri, 25 Oct 2013 17:31:51 +0800 Message-ID: Subject: [PATCH] ARM: OMAP2+: smsc911x: fix return value check in gpmc_smsc911x_init() From: Wei Yongjun To: khilman@deeprootsystems.com, tony@atomide.com, linux@arm.linux.org.uk Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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_register_resndata() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Acked-by: Igor Grinberg --- arch/arm/mach-omap2/gpmc-smsc911x.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/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c index ef99011..2757504 100644 --- a/arch/arm/mach-omap2/gpmc-smsc911x.c +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c @@ -83,7 +83,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg) pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), &gpmc_smsc911x_config, sizeof(gpmc_smsc911x_config)); - if (!pdev) { + if (IS_ERR(pdev)) { pr_err("Unable to register platform device\n"); gpio_free(gpmc_cfg->gpio_reset); goto free2;