]> 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)
commit89abd1d4a1674a5b707a3071d4994ae6270d605b
tree7a8fcaada732dcd75a49ca8ca7c9cc107655125d
parent8405a4a1fcb123e802177735d463847462106fb5
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