]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:15:36 +0000 (08:15 +0100)
commite91ffd2cf5a0834d64d301fbe1aaa9cc0449a4fa
tree0fe41f3036d2526a3949862e94f996ee74ad96a6
parent853ed8895a2d9198260c1c23dc12f59d8bd0ee40
clk: zynqmp: Fix memory allocation in zynqmp_clk_setup

commit 4f340efcb21220b7a0afcea3884e66f79e6f2306 upstream.

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: 3fde0e16d016 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/zynqmp/clkc.c