From patchwork Fri Sep 16 01:50:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9334973 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 118FF607FD for ; Fri, 16 Sep 2016 01:50:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0124A29DE1 for ; Fri, 16 Sep 2016 01:50:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8C0E29E31; Fri, 16 Sep 2016 01:50:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D61029DE1 for ; Fri, 16 Sep 2016 01:50:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755111AbcIPBuJ (ORCPT ); Thu, 15 Sep 2016 21:50:09 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36311 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755100AbcIPBuI (ORCPT ); Thu, 15 Sep 2016 21:50:08 -0400 Received: by mail-pf0-f193.google.com with SMTP id n24so2922592pfb.3 for ; Thu, 15 Sep 2016 18:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jp3vAOBuVLfX0Is33I9xFeF6WitrC26eKvFmuBXgaAE=; b=UDXlA7Isz9rLHgM4vsouDGuBddWFkkW1XqGPhSYSvKowXQCy/3qBo0+LkBWFTxxs3m 2auwyX8DjJbtf7uCzXnAd8TU8P5VZ+ImLbUF3XCiJ5wTEkEEMeK7uVmztgIEyPBo2Pv1 17sndnP4XBq4XcRzAIykkYQzDdnuD1QnC2LKxvj2QtreCq0Mh8Ij85O73VWZaY6Di4p7 ncPPzTyblfUDG72JPyT7Y42t22T9zmyPk/xMcAIIr7gzKSL3/doMrg/LMjGwtV2iCVT8 YFNn3BxqW2oOppKQJCmMZ/hK9YbSx4bRjJK4KBAD9v9EIlWIhmNJwK2/Vd6uLN4ZGnVk RGVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Jp3vAOBuVLfX0Is33I9xFeF6WitrC26eKvFmuBXgaAE=; b=GCYV38a9Feg951D0UmA/7hvplAutl17kLoLtkHCbLn/LNhf9qMTk9JS71JJoscgG1K bc0b4H046WAcTNL+8j8PETSRycSVsRSXIA6Xg3h3u6t+EDgkUzjidNjeJG1f/+HLL3Ey DUwSdP/tTNid7tsZnK18GLmv0S0uWq3pk6CbndzBVmrRJ1SvSrV5zThf1i4YVNCPhXyT 9WPqzV42j7SBmEFo+Kk35B5Il0pxQSGCQuPLz/VkdX1wwfpHA7zklkGaf1tKo+MgxnKm eUTs3vZDEfUWgemlsY61Lcc0vt0QmVhi6ImBJFXUkdOaABmSVacaL4iKn+aT5KW2IvKl bp8w== X-Gm-Message-State: AE9vXwOF8/zl9yeR9uTGqZriSYuvUjA1yNJm68YzNbbYOeJPeQ6IPVqjL4ocyL0okTq/lA== X-Received: by 10.98.39.193 with SMTP id n184mr19346098pfn.164.1473990607622; Thu, 15 Sep 2016 18:50:07 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id s1sm7659820paz.47.2016.09.15.18.50.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Sep 2016 18:50:07 -0700 (PDT) From: Wei Yongjun To: Matt Mackall , Herbert Xu , PrasannaKumar Muralidharan Cc: Wei Yongjun , linux-geode@lists.infradead.org, linux-crypto@vger.kernel.org Subject: [PATCH -next] hwrng: geode - fix return value check in mod_init() Date: Fri, 16 Sep 2016 01:50:01 +0000 Message-Id: <1473990601-18721-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 6e9b5e76882c ("hwrng: geode - Migrate to managed API") Signed-off-by: Wei Yongjun --- drivers/char/hw_random/geode-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" 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/drivers/char/hw_random/geode-rng.c b/drivers/char/hw_random/geode-rng.c index 0cae210..e7a2459 100644 --- a/drivers/char/hw_random/geode-rng.c +++ b/drivers/char/hw_random/geode-rng.c @@ -95,8 +95,8 @@ static int __init mod_init(void) return -ENODEV; mem = devm_ioremap(&pdev->dev, rng_base, 0x58); - if (IS_ERR(mem)) - return PTR_ERR(mem); + if (!mem) + return -ENOMEM; geode_rng.priv = (unsigned long)mem; pr_info("AMD Geode RNG detected\n");