From: Sachin Kamat Date: Fri, 24 Jan 2014 10:53:22 +0000 (+0530) Subject: ASoC: samsung: Add NULL check in i2s.c X-Git-Tag: v3.14-rc1~16^2~4^2^4~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57e33781ce5aaab86b4db7799f3505988b5226e2;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Mark Brown --- diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 92f64363..a9da24f 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; }