Files
kernel_xiaomi_raphael/include/linux
Jerome Brunet e6bc3a4b0c clk: divider: fix incorrect usage of container_of
[ Upstream commit 12a26c298d2a8b1cab498533fa65198e49e3afd3 ]

divider_recalc_rate() is an helper function used by clock divider of
different types, so the structure containing the 'hw' pointer is not
always a 'struct clk_divider'

At the following line:
> div = _get_div(table, val, flags, divider->width);

in several cases, the value of 'divider->width' is garbage as the actual
structure behind this memory is not a 'struct clk_divider'

Fortunately, this width value is used by _get_val() only when
CLK_DIVIDER_MAX_AT_ZERO flag is set. This has never been the case so
far when the structure is not a 'struct clk_divider'. This is probably
why we did not notice this bug before

Fixes: afe76c8fd0 ("clk: allow a clk divider with max divisor when zero")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-12 12:32:13 +02:00
..
2017-06-08 18:52:36 -07:00
2017-12-29 17:53:47 +01:00
2017-12-25 14:26:33 +01:00
2017-07-03 16:56:28 -06:00
2018-02-22 15:42:23 +01:00
2017-08-30 14:40:40 +02:00
2018-01-17 09:45:27 +01:00
2017-08-24 13:23:03 -07:00
2018-02-22 15:42:23 +01:00
2017-07-17 13:42:48 +02:00
2017-08-03 19:09:26 -07:00
2017-08-07 17:22:14 +02:00
2018-02-22 15:42:23 +01:00
2017-09-08 18:26:46 -07:00
2017-05-18 10:07:40 -04:00
2017-06-21 14:37:12 -04:00
2018-02-22 15:42:24 +01:00
2017-08-15 18:23:52 +02:00
2017-08-14 13:33:39 -07:00
2017-08-28 20:51:22 +02:00
2017-09-07 11:53:11 +02:00
2018-02-22 15:42:23 +01:00
2018-02-22 15:42:23 +01:00
2017-07-06 11:30:07 -04:00
2017-07-25 18:05:25 +02:00
2017-09-25 08:56:05 -06:00
2017-12-20 10:10:18 +01:00
2017-05-26 10:10:37 +02:00
2017-08-06 20:55:29 -07:00
2018-02-22 15:42:23 +01:00
2017-07-06 16:24:30 -07:00
2017-08-16 16:28:47 -07:00
2018-02-22 15:42:23 +01:00
2017-07-24 17:50:37 +02:00
2017-08-31 18:50:14 +02:00
2017-08-15 09:02:07 -07:00
2017-08-15 09:02:08 -07:00