[3.13.y-ckt stable] Patch "clk: versatile: off by one in clk_sp810_timerclken_of_get()" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Oct 20 21:33:31 UTC 2015


This is a note to let you know that I have just added a patch titled

    clk: versatile: off by one in clk_sp810_timerclken_of_get()

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt28.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From b3ac6e4b39d806c4d39078f3959aeca8e1af1ec1 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter at oracle.com>
Date: Wed, 29 Jul 2015 13:17:06 +0300
Subject: clk: versatile: off by one in clk_sp810_timerclken_of_get()

commit 3294bee87091be5f179474f6c39d1d87769635e2 upstream.

The ">" should be ">=" or we end up reading beyond the end of the array.

Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver')
Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
Acked-by: Pawel Moll <pawel.moll at arm.com>
Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 drivers/clk/versatile/clk-sp810.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c
index bf9b15a..b9e05bd 100644
--- a/drivers/clk/versatile/clk-sp810.c
+++ b/drivers/clk/versatile/clk-sp810.c
@@ -128,8 +128,8 @@ struct clk *clk_sp810_timerclken_of_get(struct of_phandle_args *clkspec,
 {
 	struct clk_sp810 *sp810 = data;

-	if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
-			ARRAY_SIZE(sp810->timerclken)))
+	if (WARN_ON(clkspec->args_count != 1 ||
+		    clkspec->args[0] >=	ARRAY_SIZE(sp810->timerclken)))
 		return NULL;

 	return sp810->timerclken[clkspec->args[0]].clk;
--
1.9.1





More information about the kernel-team mailing list