Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184AbbF2Iu5 (ORCPT ); Mon, 29 Jun 2015 04:50:57 -0400 Received: from mail-yk0-f171.google.com ([209.85.160.171]:35821 "EHLO mail-yk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752613AbbF2Ius (ORCPT ); Mon, 29 Jun 2015 04:50:48 -0400 MIME-Version: 1.0 In-Reply-To: <1435485332-14951-1-git-send-email-daniel.thompson@linaro.org> References: <1435485332-14951-1-git-send-email-daniel.thompson@linaro.org> Date: Mon, 29 Jun 2015 10:50:47 +0200 Message-ID: Subject: Re: [PATCH] clk: stm32: Fix out-by-one error path in the index lookup From: Maxime Coquelin To: Daniel Thompson Cc: Mike Turquette , Stephen Boyd , linux-clk@vger.kernel.org, "linux-kernel@vger.kernel.org" , patches@linaro.org, linaro-kernel@lists.linaro.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 978 Lines: 29 Hi Daniel, 2015-06-28 11:55 GMT+02:00 Daniel Thompson : > If stm32f4_rcc_lookup() is called with primary == 0 and secondary == 192 > then it will read beyond the end of the table array due to an out-by-one > error in the range check. > > In addition to the fixing the inequality we also modify the r.h.s. to > make it even more explicit that we are comparing against the size of > table in bits. > > Reported-by: Dan Carpenter > Signed-off-by: Daniel Thompson > --- > drivers/clk/clk-stm32f4.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks for the patch. Acked-by: Maxime Coquelin Regards, Maxime -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/