ASoC: rockchip: Allocate enough memory so we don't overflow routes
authorDouglas Anderson <dianders@chromium.org>
Fri, 29 Sep 2017 22:03:24 +0000 (15:03 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 4 Oct 2017 10:30:17 +0000 (11:30 +0100)
commit8eae6c2585b0455f0e7200495d5e513020ca2fa2
tree9572d35a4c168595ec9d10e4163aae728910cf6c
parent7e0dc9aeaea3ed130e090e20e9be0fc4877ddc37
ASoC: rockchip: Allocate enough memory so we don't overflow routes

In the recent commit d9f9c167edae ("ASoC: rockchip: Init dapm routes
dynamically") we improperly allocated memory for the card->dapm_routes
causing us to overflow the allocation on every boot.  Oops.

Let's allocate the correct amount of memory.  We'll also add a check
to make sure that we don't overrun memory even if we encounter some
sort of weird device tree.

Fixes: d9f9c167edae ("ASoC: rockchip: Init dapm routes dynamically")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rk3399_gru_sound.c