]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitdf433d4d0ef4200eef51ff2a418564032c3f4416
tree7a8fcaada732dcd75a49ca8ca7c9cc107655125d
parenta323f37b591f4ca24e72032c83bb81ad890d27aa
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