From patchwork Mon Aug 22 02:37:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9292795 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 EE342607F0 for ; Mon, 22 Aug 2016 02:38:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0E5D287E9 for ; Mon, 22 Aug 2016 02:38:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0F802882E; Mon, 22 Aug 2016 02:38: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 456FD287E9 for ; Mon, 22 Aug 2016 02:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600AbcHVCiH (ORCPT ); Sun, 21 Aug 2016 22:38:07 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36237 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753501AbcHVCiG (ORCPT ); Sun, 21 Aug 2016 22:38:06 -0400 Received: by mail-qk0-f196.google.com with SMTP id v123so7796686qkh.3 for ; Sun, 21 Aug 2016 19:38:06 -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; bh=3HkKXuKnFcJ9jOIBXxXjzUTtQQttrq76RnHaSyLILw0=; b=s24E92VfdLk+NheKeu6+JhAJ9vlPX4lEHQz8uo9JOfaaaNvBct9roMeG5PQs0B4mQE w0PJ4HXfEl7MO7dAeeJXFUw6emH/ys3E/YKbySWZ2Z003i3zpx0OWprU0L3euiBXbjwv RiUrKqGUdV1i2j9FSX+aBWYxQ3p4A+x+vUUD1C6+kuzup3vkY1gLgeBSk87UYTXZCfl1 QTsXpJAqGIbFPq1LAyM1DHnX785zxpoFrcatGkwp7hvnqDvH4ifooXbTiJQ33++KDSNJ tyUuV18IXcXja/pZUo6Gdyb/tMKjUDbZ3vfudVIBBXh4xxNuaggP22dUbuRkYZ/zk53v 6BCw== 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; bh=3HkKXuKnFcJ9jOIBXxXjzUTtQQttrq76RnHaSyLILw0=; b=SCiIl1VSvKao7Cl4TfpC6DUM28BFCEe2Z7SqcNC+lsgWXN2Wq9Bx7cvviFm8J3IFIA LFePbfDMRABRGAjiawdehwDxDNqQqGSMjQ8YkVrS2kAVKtT0B2VdcDPygfqxu/sAwheA prkpLcOZybqStaO26UN2iuQfk7Da8jz7o/ZLx/O2N4a3GAKiFGmI2ZaVILuCkyH3MoZm qbnCYrAb4A+CZ4sdJ2uPooLM3Vu+sGGi+x42ILerqanzI6vmEJtBY1tqD19OWDfQsiWI tC8YbpS3+Ru/OsFxMjJABBI7K4ENgpnM1aBya0IKFjgjFITogdAGKkuS/Gsf2aAlHiSV PVcA== X-Gm-Message-State: AE9vXwMhcG7jqp/bcbVWgqVh4Agtq2SLwVMjDGuu+y/iQGpjhD8BccpqmxJ+/pvEjnAlYQ== X-Received: by 10.55.72.79 with SMTP id v76mr20684190qka.194.1471833485644; Sun, 21 Aug 2016 19:38:05 -0700 (PDT) Received: from localhost.localdomain ([187.180.185.30]) by smtp.gmail.com with ESMTPSA id q131sm10121476qke.31.2016.08.21.19.38.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Aug 2016 19:38:05 -0700 (PDT) From: Fabio Estevam To: herbert@gondor.apana.org.au Cc: s.trumtrar@pengutronix.de, linux-crypto@vger.kernel.org, Fabio Estevam Subject: [PATCH] crypto: mxc-scc - check clk_prepare_enable() error Date: Sun, 21 Aug 2016 23:37:27 -0300 Message-Id: <1471833447-11446-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 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: Fabio Estevam clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of failure. Signed-off-by: Fabio Estevam --- drivers/crypto/mxc-scc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/mxc-scc.c b/drivers/crypto/mxc-scc.c index ff383ef..ee4be1b0 100644 --- a/drivers/crypto/mxc-scc.c +++ b/drivers/crypto/mxc-scc.c @@ -668,7 +668,9 @@ static int mxc_scc_probe(struct platform_device *pdev) return PTR_ERR(scc->clk); } - clk_prepare_enable(scc->clk); + ret = clk_prepare_enable(scc->clk); + if (ret) + return ret; /* clear error status register */ writel(0x0, scc->base + SCC_SCM_ERROR_STATUS);