From patchwork Fri Sep 21 06:30:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1489721 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 EA25EDF28C for ; Fri, 21 Sep 2012 06:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812Ab2IUGav (ORCPT ); Fri, 21 Sep 2012 02:30:51 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:52420 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754589Ab2IUGau (ORCPT ); Fri, 21 Sep 2012 02:30:50 -0400 Received: by qaas11 with SMTP id s11so1011432qaa.19 for ; Thu, 20 Sep 2012 23:30:50 -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=LdDS7F63XcWUVaHGr9vkdlnnMPZsBvg4ML/KKFkJtOc=; b=c2bSvX9YsDRpgM2j5T7c+8LB1BDFDggCWoso/rs56LJuzXd84nZ07ebSsEG3QSx9pm i3nDimy8sRLExO9AVtxD39HSmJLH8ZMZvFuGKne2TLI4pH/T2XFuHOQoDd48iW8zg+Y2 2PY4f3T4ibfNf3Bl/obyJQB5lio3WqMi6c7oN1T2bg3kToXRYSbXLFoMJHlhgcaKuMot xiDV1feNVtVS4csBin6cxYeAzgSgbjbIcEv8IrhATlNvrgkg0NroWgqCeij0/6quuaOL qBhEN9GBrqNp6T/krwyxiwS7n+xjjth3rU7vGH5v+o6rNsI3JlPXsNOTkMFudVoxX0yB NPug== MIME-Version: 1.0 Received: by 10.224.100.200 with SMTP id z8mr10041271qan.75.1348209050167; Thu, 20 Sep 2012 23:30:50 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 20 Sep 2012 23:30:50 -0700 (PDT) Date: Fri, 21 Sep 2012 14:30:50 +0800 Message-ID: Subject: [PATCH] ARM: OMAP: hsmmc: fix return value check in omap_hsmmc_init_one() 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/hsmmc.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/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index a9675d8..95179fe 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -522,7 +522,7 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo, dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id); od = omap_device_alloc(pdev, ohs, 1, NULL, 0); - if (!od) { + if (IS_ERR(od)) { pr_err("Could not allocate od for %s\n", name); goto put_pdev; }