From patchwork Thu Jul 4 13:42:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2823731 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 A34739F9D2 for ; Thu, 4 Jul 2013 13:42:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71F4B20187 for ; Thu, 4 Jul 2013 13:42:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 261DE2017E for ; Thu, 4 Jul 2013 13:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216Ab3GDNmg (ORCPT ); Thu, 4 Jul 2013 09:42:36 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:60304 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468Ab3GDNmg (ORCPT ); Thu, 4 Jul 2013 09:42:36 -0400 Received: by mail-bk0-f54.google.com with SMTP id it16so661816bkc.13 for ; Thu, 04 Jul 2013 06:42:35 -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=ES3USFa3mWQiDkOCW0X54OmHrNp9RYgD3OBZQGiVF3Y=; b=tkL8/xhc3WIEXA797oH2ygaqMlxzq8IzfxRPp+6bWlpgSubd5u3Tn1LvExUKfEgwWI 2CldESxNL3OcG+xUPxCJ0CHlgRqRZWp4AJM6e/LHt/iCeA2yTClRFKj6va3YQWjeYlQ/ 28f2BmsHYmSzQRzh6gUgv7/ANz2xO/rb6oGuGmVTWHnL+A7V5LKDMEO2/CQJgXcqJI2M jqjl2//ShgfY5crg77ayR0e3w1Gp8bA0wEQWp5rrYw5b+FPJJEOWbhkFt5Gg18tI3x5a RHHFUxkCtZBAg6845ppVG1ZakUpt7l+jIl7Fhe3aM96nOU2C6YXKWD/FEAQ9J9A1q6Ou gIew== MIME-Version: 1.0 X-Received: by 10.204.224.77 with SMTP id in13mr1121221bkb.24.1372945354975; Thu, 04 Jul 2013 06:42:34 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Thu, 4 Jul 2013 06:42:34 -0700 (PDT) Date: Thu, 4 Jul 2013 21:42:34 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: fix return value check in omap_device_build_from_dt() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk Cc: yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.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.0 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 omap_device_alloc() 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: Kevin Hilman --- arch/arm/mach-omap2/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/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 5cc9287..28e70c0 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -155,7 +155,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev) } od = omap_device_alloc(pdev, hwmods, oh_cnt); - if (!od) { + if (IS_ERR(od)) { dev_err(&pdev->dev, "Cannot allocate omap_device for :%s\n", oh_name); ret = PTR_ERR(od);