Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38170 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752513AbbGaBYP (ORCPT ); Thu, 30 Jul 2015 21:24:15 -0400 Subject: Patch "PM / clk: Fix clock error check in __pm_clk_add()" has been added to the 4.1-stable tree To: geert+renesas@glider.be, gregkh@linuxfoundation.org, rafael.j.wysocki@intel.com Cc: , From: Date: Thu, 30 Jul 2015 18:24:14 -0700 Message-ID: <143830585414749@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled PM / clk: Fix clock error check in __pm_clk_add() to the 4.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pm-clk-fix-clock-error-check-in-__pm_clk_add.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From 3fc3a0be0dab352e065d1dad7d3f81953ed0d4bc Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 8 May 2015 10:47:43 +0200 Subject: PM / clk: Fix clock error check in __pm_clk_add() From: Geert Uytterhoeven commit 3fc3a0be0dab352e065d1dad7d3f81953ed0d4bc upstream. In the final iteration of commit 245bd6f6af8a62a2 ("PM / clock_ops: Add pm_clk_add_clk()"), a refcount increment was added by Grygorii Strashko. However, the accompanying IS_ERR() check operates on the wrong clock pointer, which is always zero at this point, i.e. not an error. This may lead to a NULL pointer dereference later, when __clk_get() tries to dereference an error pointer. Check the passed clock pointer instead to fix this. Signed-off-by: Geert Uytterhoeven Fixes: 245bd6f6af8a62a2 ("PM / clock_ops: Add pm_clk_add_clk()") Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/base/power/clock_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c @@ -93,7 +93,7 @@ static int __pm_clk_add(struct device *d return -ENOMEM; } } else { - if (IS_ERR(ce->clk) || !__clk_get(clk)) { + if (IS_ERR(clk) || !__clk_get(clk)) { kfree(ce); return -ENOENT; } Patches currently in stable-queue which might be from geert+renesas@glider.be are queue-4.1/pm-clk-fix-clock-error-check-in-__pm_clk_add.patch