ASoC: sst_platform: fix memory leak
authorLu Guanqun <guanqun.lu@intel.com>
Tue, 6 Sep 2011 07:21:43 +0000 (15:21 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 8 Sep 2011 22:43:03 +0000 (15:43 -0700)
commit283e42e0114aba331b0055839f6277a4a7cfbc64
treed317ef3b3f47715339ec6fc030ad7bf5b2674734
parent22be504aaa4a3133d81e3fb0c4287960aea19c37
ASoC: sst_platform: fix memory leak

snd_pcm_hw_constraint_integer() could return -1, in this case, sst platform is
not opened successfully.  However the corresponding close callback isn't able
to be called later on to release these two allocated memories, thus resulting
in memory leak.

This patch moves the check for hardware contraints earlier, thus resolving this
issue.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/mid-x86/sst_platform.c