From patchwork Sat Sep 10 12:03:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9324949 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 4B21760780 for ; Sat, 10 Sep 2016 12:10:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3573929473 for ; Sat, 10 Sep 2016 12:10:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25F6729799; Sat, 10 Sep 2016 12:10:20 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6ECA329473 for ; Sat, 10 Sep 2016 12:10:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bih14-0004nL-1W; Sat, 10 Sep 2016 12:04:14 +0000 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bih0x-0004kD-RL for linux-arm-kernel@lists.infradead.org; Sat, 10 Sep 2016 12:04:08 +0000 Received: by mail-pa0-x241.google.com with SMTP id pp5so5153269pac.2 for ; Sat, 10 Sep 2016 05:03:47 -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=ZwV6qT0Vi7cD6uFBxIGB2tTd8/ey002cxpf//acr7kQ=; b=UL84TLj6o2wWMJwQvjT6ocbeQ1RdjH1iM33+IUKS3SsOE2uziyiVvah7Ga9A9IlrbH dosaRDmjrhDtGOyZOTtEEJN8p0yQEJHEfD1oAw4wtMCJsmOLHnDzhPGiN05O1juWbBq3 8aPm0rSX+anGZUnf2f3Zw36FZHpWhnhNXt31RooNg+LgsAn1ye5aAIP/tuQtvICImToh FXIHcM8JR0ZcjUMx7lKNwH35t+LWut+dve32m014YUUKdiS8BHFLG/N9qQdhhG8NpbV9 +9cQg0a+fkBDPQbp2F97ijVt5Y2p0KIRnoQ/d8wuAoAnMh0JMtRY0kY7D0pF40zs2a0G +0ww== 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=ZwV6qT0Vi7cD6uFBxIGB2tTd8/ey002cxpf//acr7kQ=; b=FPeG8o7pUnZfylhP92FiGd6xbq66/z4oMKifq74+NbqZF2T3CGJ05C2GH8t6wytBH+ 8nj4KwyPUP3n5yvOnR2gwDOyu8xXyTq/brALDPMCa3sOTpUFF4OPOCSaG8yfsgGIGlWB VoNqwNSN5fFv/luZh7LYRG1P6FLE8BHkq7NGTuTkLyxf+2/P9bIbnl3vt/Tf5034eJCp Zpx1GDzhNyomB7RQONPBJI1Ap+T+G7QapqdWya86oF24I2KdCh7vVwPrn3SzCiGgXSZS jJvIhsfxUemigYJJ2jbQ/TYqDTSfrZWK7NJHSIZKn7DmWbyQQdcOLKAeIw1c4O1P2qrF S3QA== X-Gm-Message-State: AE9vXwPt/wxlCJdfCcLocZDMHT1AdVLKQNykCZ3kAVRv4T+Vh3ZUH7xvK9jqTXIULWaI2A== X-Received: by 10.66.132.81 with SMTP id os17mr15466854pab.106.1473509026983; Sat, 10 Sep 2016 05:03:46 -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 x66sm11897707pfb.86.2016.09.10.05.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Sep 2016 05:03:46 -0700 (PDT) From: Wei Yongjun To: Patrice Chotard , Matt Mackall , Herbert Xu Subject: [PATCH -next] hwrng: st - Fix missing clk_disable_unprepare() on error in st_rng_probe() Date: Sat, 10 Sep 2016 12:03:42 +0000 Message-Id: <1473509022-3478-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160910_050407_964141_2ABA216E X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Yongjun , kernel@stlinux.com, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix the missing clk_disable_unprepare() before return from st_rng_probe() in the error handling case. Signed-off-by: Wei Yongjun Acked-by: Patrice Chotard Acked-by: Peter Griffin --- drivers/char/hw_random/st-rng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/st-rng.c b/drivers/char/hw_random/st-rng.c index 7e8aa6b..938ec10 100644 --- a/drivers/char/hw_random/st-rng.c +++ b/drivers/char/hw_random/st-rng.c @@ -108,6 +108,7 @@ static int st_rng_probe(struct platform_device *pdev) ret = hwrng_register(&ddata->ops); if (ret) { dev_err(&pdev->dev, "Failed to register HW RNG\n"); + clk_disable_unprepare(clk); return ret; }