linux-stable/drivers/clk/hisilicon
Jerome Brunet 12a26c298d clk: divider: fix incorrect usage of container_of
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>
2017-12-28 15:16:04 -08:00
..
clk-hi3519.c clk: hisilicon: hi3519: add driver remove path and fix some issues 2016-06-30 12:35:20 -07:00
clk-hi3620.c clk: hisilicon: make clk_ops const 2017-11-01 23:25:45 -07:00
clk-hi3660.c clk: hi3660: fix incorrect uart3 clock freqency 2017-11-14 09:48:59 -08:00
clk-hi6220-stub.c clk: hisilicon: Remove CLK_IS_ROOT 2016-03-02 17:43:32 -08:00
clk-hi6220.c clk: hi6220: mark clock cs_atb_syspll as critical 2017-11-01 16:39:03 +01:00
clk-hip04.c clk: hisilicon: Remove CLK_IS_ROOT 2016-03-02 17:43:32 -08:00
clk-hix5hd2.c clk: hisilicon: make clk_ops const 2017-11-01 23:25:45 -07:00
clk.c clk: hisilicon: Delete error messages for failed memory allocations in hisi_clk_init() 2017-04-19 10:45:52 -07:00
clk.h clk: hisilicon: add hisi_clk_unregister_* functions 2016-06-30 12:35:18 -07:00
clkdivider-hi6220.c clk: divider: fix incorrect usage of container_of 2017-12-28 15:16:04 -08:00
clkgate-separated.c Merge branch 'clk-const' into clk-next 2017-11-14 10:07:38 -08:00
crg-hi3516cv300.c clk: hisilicon: add CRG driver for Hi3516CV300 SoC 2016-11-14 12:04:39 -08:00
crg-hi3798cv200.c clk: hi3798cv200: correct parent mux clock for 'clk_sdio0_ciu' 2017-11-14 09:49:00 -08:00
crg.h clk: hisilicon: add CRG driver for Hi3798CV200 SoC 2016-11-11 15:43:49 -08:00
Kconfig clk: hisilicon: Add clock driver for hi3660 SoC 2017-01-09 16:20:38 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reset.c reset: hisilicon: change the definition of hisi_reset_init 2016-06-30 12:33:22 -07:00
reset.h reset: hisilicon: change the definition of hisi_reset_init 2016-06-30 12:33:22 -07:00