From patchwork Wed Oct 30 05:23:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3113041 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A6BEBF924 for ; Wed, 30 Oct 2013 05:23:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B298201F4 for ; Wed, 30 Oct 2013 05:23:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CD96201E9 for ; Wed, 30 Oct 2013 05:23:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750724Ab3J3FXX (ORCPT ); Wed, 30 Oct 2013 01:23:23 -0400 Received: from mail-bk0-f44.google.com ([209.85.214.44]:64181 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709Ab3J3FXW (ORCPT ); Wed, 30 Oct 2013 01:23:22 -0400 Received: by mail-bk0-f44.google.com with SMTP id mx11so269584bkb.17 for ; Tue, 29 Oct 2013 22:23:21 -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=cuFmJEfzWNTtLgwvdAyZaV+MCsTj/8+axPpAVUEyMpg=; b=T1UHJ9mGtfuX3Z2fEdlWxcFUgkiC3Z3nbUV9ALsjXu5/2mt42nMlupMXkhupCrwz5F 00jj//Aw9kAuZWAKfnx/IZjjSxJFKVZa+WfEhlgW8Y8kmrIzY8ViGTVy28NYSryOfeeZ Ej8Ta2Hlzcgt46zSC79f5gcFZ6xw1VfAtnu8AE5p713rq8pBAsDRfbeTO5sULxPXkJdQ B5CB2PYkFfK+JEzE/CBwlO5JlOQFxaytwu1V0FNZO0qC2a+F0qgv01dE+7MfmZckI4tJ qxhR0hK+x9pjGQZFtJB+ENLuYD4MF02W77YEszYSmCOTl8+Di6hEK84aJ/SKD9Zj8gE+ oZqg== MIME-Version: 1.0 X-Received: by 10.204.228.198 with SMTP id jf6mr20361bkb.41.1383110601307; Tue, 29 Oct 2013 22:23:21 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Tue, 29 Oct 2013 22:23:21 -0700 (PDT) Date: Wed, 30 Oct 2013 13:23:21 +0800 Message-ID: Subject: [PATCH] ARM: OMAP3: Beagle: fix return value check in beagle_opp_init() 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 X-Spam-Status: No, score=-7.3 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 get_cpu_device() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- arch/arm/mach-omap2/board-omap3beagle.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/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index a516c1b..d6ed819 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -510,7 +510,7 @@ static int __init beagle_opp_init(void) mpu_dev = get_cpu_device(0); iva_dev = omap_device_get_by_hwmod_name("iva"); - if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { + if (!mpu_dev || IS_ERR(iva_dev)) { pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", __func__, mpu_dev, iva_dev); return -ENODEV;