1
0
Fork 0
remarkable-linux/include
Jerome Brunet e6bc3a4b0c clk: divider: fix incorrect usage of container_of
[ Upstream commit 12a26c298d ]

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
..
acpi ACPI / EC: Fix regression related to PM ops support in ECDT device 2017-12-05 11:26:33 +01:00
asm-generic mm/vmalloc: add interfaces to free unmapped page table 2018-03-28 18:24:38 +02:00
clocksource License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crypto crypto: af_alg - Fix race around ctx->rcvused by making it atomic_t 2018-03-03 10:24:29 +01:00
drm drm/syncobj: Stop reusing the same struct file for all syncobj -> fd 2018-03-28 18:24:47 +02:00
dt-bindings License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
keys License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kvm arm/arm64: KVM: Turn kvm_psci_version into a static inline 2018-02-16 20:22:55 +01:00
linux clk: divider: fix incorrect usage of container_of 2018-04-12 12:32:13 +02:00
math-emu
media License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
memory
misc
net sch_netem: fix skb leak in netem_enqueue() 2018-03-31 18:10:40 +02:00
pcmcia
ras License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rdma RDMA/ucma: Introduce safer rdma_addr_size() variants 2018-04-08 14:26:29 +02:00
scsi scsi: core: Avoid that ATA error handling can trigger a kernel hang or oops 2018-03-15 10:54:29 +01:00
soc ARM: SoC driver updates for v4.14 2017-09-10 20:40:00 -07:00
sound ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization 2017-11-30 08:40:49 +00:00
target target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK 2017-11-30 08:40:51 +00:00
trace mmc: core: Fix tracepoint print of blk_addr and blksz 2018-03-28 18:24:30 +02:00
uapi serial: 8250: Add Nuvoton NPCM UART 2018-04-08 14:26:30 +02:00
video License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen xen/balloon: Mark unallocated host memory as UNUSABLE 2018-03-03 10:24:28 +01:00