From patchwork Fri Sep 21 06:28:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489701 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 75689DF28C for ; Fri, 21 Sep 2012 06:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068Ab2IUG2y (ORCPT ); Fri, 21 Sep 2012 02:28:54 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:50444 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440Ab2IUG2y (ORCPT ); Fri, 21 Sep 2012 02:28:54 -0400 Received: by vbbff1 with SMTP id ff1so3487883vbb.19 for ; Thu, 20 Sep 2012 23:28:53 -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=iZxG/oKpFBedEVhswG9rcvyhq6ZHv0qjO1BvMSKfdiI=; b=j12PXU0Z1GF0WJ+7TPrrR/E56dt5ejukGD1tx1Rq6egFlwuNLZS/u+U+AU2sOAsFh7 pGK/wu5Z93+B5hE0GLO6tRrKDdXg23iZaUqVJSbbfA5AJftI3W8KE1a83lWKnMPrwljQ Plqmj5j0nUuLlbFrPkhgcq/6hfKuVX61rS7JeDYviNQls94cOMLjwiSu1MBs1DBRydRf QTOZC0H26ubw3NgMma9CY/vjKqeZumqTYN4ImOLoHmypMpnjrTyEkPXXGjPg59/FLg/6 pfMszAntgoz5wCuL6UkuwKdPGwrAKwldogBxxnsn4ljhpb0Qtmib2lmAI7YLURb0MQKd 6Q7g== MIME-Version: 1.0 Received: by 10.52.26.228 with SMTP id o4mr1302733vdg.72.1348208933563; Thu, 20 Sep 2012 23:28:53 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:28:23 -0700 (PDT) Date: Fri, 21 Sep 2012 14:28:23 +0800 Message-ID: Subject: [PATCH] OMAPDSS: fix return value check in create_dss_pdev() From: Wei Yongjun To: 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 From: Wei Yongjun In case of error, the function omap_device_alloc() returns ERR_PTR() not 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 --- arch/arm/mach-omap2/display.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/display.c b/arch/arm/mach-omap2/display.c index af1ed7d..eb1bd01 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -221,7 +221,7 @@ static struct platform_device *create_dss_pdev(const char *pdev_name, ohs[0] = oh; od = omap_device_alloc(pdev, ohs, 1, NULL, 0); - if (!od) { + if (IS_ERR(od)) { pr_err("Could not alloc omap_device for %s\n", pdev_name); r = -ENOMEM; goto err;