[alsa-devel] [PATCH 1/3] ASoC: Samsung: Add NULL check in i2s.c
'res' could be NULL from one of the operations above (line 1243). Thus check 'res' for NULL before releasing the region to avoid null pointer dereference.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 92f64363427d..a9da24f34834 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1268,7 +1268,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
return 0; err: - release_mem_region(regs_base, resource_size(res)); + if (res) + release_mem_region(regs_base, resource_size(res));
return ret; }
mach/dma.h is not referenced by this file. Remove it.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/i2s.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index a9da24f34834..0a9b44c940ce 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -22,8 +22,6 @@ #include <sound/soc.h> #include <sound/pcm_params.h>
-#include <mach/dma.h> - #include <linux/platform_data/asoc-s3c.h>
#include "dma.h"
Samsung sound drivers use mach/dma.h which is not available on multiplatform. Hence disable audio support on multiplatform build for now. Without this patch we get the following build errors:
sound/soc/samsung/pcm.c:23:22: fatal error: mach/dma.h: No such file or directory #include <mach/dma.h> sound/soc/samsung/spdif.c:21:22: fatal error: mach/dma.h: No such file or directory #include <mach/dma.h>
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/samsung/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index e8fbf4e5732f..3a031af5febd 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -170,7 +170,7 @@ config SND_SOC_GONI_AQUILA_WM8994
config SND_SOC_SAMSUNG_SMDK_SPDIF tristate "SoC S/PDIF Audio support for SMDK" - depends on SND_SOC_SAMSUNG + depends on SND_SOC_SAMSUNG && !ARCH_MULTIPLATFORM select SND_SAMSUNG_SPDIF help Say Y if you want to add support for SoC S/PDIF audio on the SMDK. @@ -185,7 +185,7 @@ config SND_SOC_SMDK_WM8580_PCM
config SND_SOC_SMDK_WM8994_PCM tristate "SoC PCM Audio support for WM8994 on SMDK" - depends on SND_SOC_SAMSUNG + depends on SND_SOC_SAMSUNG && !ARCH_MULTIPLATFORM depends on I2C=y select MFD_WM8994 select SND_SOC_WM8994
On Fri, Jan 24, 2014 at 04:23:24PM +0530, Sachin Kamat wrote:
Samsung sound drivers use mach/dma.h which is not available on multiplatform. Hence disable audio support on multiplatform build for now. Without this patch we get the following build errors:
No, the thing to do here is fix the multiplatform build.
On 24 January 2014 17:02, Mark Brown broonie@kernel.org wrote:
On Fri, Jan 24, 2014 at 04:23:24PM +0530, Sachin Kamat wrote:
Samsung sound drivers use mach/dma.h which is not available on multiplatform. Hence disable audio support on multiplatform build for now. Without this patch we get the following build errors:
No, the thing to do here is fix the multiplatform build.
Yes this is only masking the build error temporarily until the code becomes multi-platform aware. Since legacy code is involved in this, I am not aware if it is going to happen sooner than later.
On Fri, Jan 24, 2014 at 05:25:09PM +0530, Sachin Kamat wrote:
On 24 January 2014 17:02, Mark Brown broonie@kernel.org wrote:
No, the thing to do here is fix the multiplatform build.
Yes this is only masking the build error temporarily until the code becomes multi-platform aware. Since legacy code is involved in this, I am not aware if it is going to happen sooner than later.
We're just waiting for the s3c24xx DMA driver to be deployed, it's merged. In the meantime you should fix the build so those platforms that can be multiplatform are buildable there.
participants (2)
-
Mark Brown
-
Sachin Kamat