From d5a3ff12ee04d1a7c2ad243bf64b74e59265e010 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 24 Jan 2014 16:23:22 +0530 Subject: 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. Change-Id: Iade84bccdfb1858c55ccf4cc5ef5ece3d51d9e00 Signed-off-by: Sachin Kamat Signed-off-by: Mark Brown --- sound/soc/samsung/i2s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound') diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index bce311d9d9c..3cfda177f06 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1337,7 +1337,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; } -- cgit v1.2.3