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: 9324945 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 5D1AD60780 for ; Sat, 10 Sep 2016 12:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AC09299CD for ; Sat, 10 Sep 2016 12:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EB19299D1; Sat, 10 Sep 2016 12:03:51 +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 9AA97299CD for ; Sat, 10 Sep 2016 12:03:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751174AbcIJMDs (ORCPT ); Sat, 10 Sep 2016 08:03:48 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:35899 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751126AbcIJMDr (ORCPT ); Sat, 10 Sep 2016 08:03:47 -0400 Received: by mail-pa0-f65.google.com with SMTP id ez1so5144373pab.3 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=iSs5BqI1rN3NYsvNM0EivaiHjU2Daw6NsGmwAxKAESrMionUthVLz3FRnMXRfFf31h pQ185OUbSlFR5qAh7ltYp+/7gJclOWkwsooiIxSkWpc1s+N2ufzHQwfO5xscu39YDKRX WvMBbFFZG1Ma7OrLtCDufbfskOOJetPWjbzqBYHbEFhRTdCAFCpbsCHVGpC+VmfO/YBI RUvxPpAL5o8u+bpLwIJZP0zKcnyFoeJFLproqIyZ4fnJePmHYbcp/n4iepiIOvUUMj2u l08nXAzfDwVNtNb/HnuVwP461jkl4p8Q792PBqLfWXu5nXYwfkYFTuhfDciEdYsd+H5t 1f6g== X-Gm-Message-State: AE9vXwM7DmZmDuFoD95a7N3+pL2eoYPwY0PuA0G9etdUNTrlKYYQF78rv/EkUVRs7+UvDw== 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 Cc: Wei Yongjun , linux-arm-kernel@lists.infradead.org, kernel@stlinux.com, linux-crypto@vger.kernel.org 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 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 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(+) -- 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/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; }