ASoC: topology: Add missing memory checks
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 27 Mar 2020 20:47:24 +0000 (16:47 -0400)
committerMark Brown <broonie@kernel.org>
Thu, 9 Apr 2020 11:46:03 +0000 (12:46 +0100)
commitabc3caac24501008465fdb55c5e89e16d58d5a3d
tree7a8fcaada732dcd75a49ca8ca7c9cc107655125d
parentccfc531695f3a4aada042f6bdb33ac6be24e1aec
ASoC: topology: Add missing memory checks

kstrdup is an allocation function and it can fail, so its return value
should be checked and handled appropriately.

In order to check all cases, we need to modify set_stream_info to return
a value, so check that everything went correctly when doing kstrdup().
Later add proper checks and error handlers.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c