]> git.baikalelectronics.ru Git - kernel.git/commit
clk: zynqmp: Fix memory allocation in zynqmp_clk_setup
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 24 Dec 2018 05:50:58 +0000 (23:50 -0600)
committerStephen Boyd <sboyd@kernel.org>
Wed, 9 Jan 2019 18:37:01 +0000 (10:37 -0800)
commit4403c7bc72bb27f4a1f3eade6e2b30ab5484694e
tree1ca057f607ae723bee9f58d485d445e9c9316de3
parente0f21dc9a01c98cc938d108b3290fa1d97da3ffb
clk: zynqmp: Fix memory allocation in zynqmp_clk_setup

Fix memory allocation and use struct_size() in kzalloc(). This also
fixes the allocation size to be correct, and smaller, because before we
were allocating a bunch of sizeof(struct clk_hw_onecell_data) structures
for each struct clk_hw we needed.

Fixes: 363fef7b7f44 ("drivers: clk: Add ZynqMP clock driver")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
[sboyd@kernel.org: Expand commit text]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/zynqmp/clkc.c