Skip to content

Commit

Permalink
ASoC: samsung: Add NULL check in i2s.c
Browse files Browse the repository at this point in the history
'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>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Sachin Kamat authored and Mark Brown committed Jan 24, 2014
1 parent 9b35a7b commit 57e3378
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/soc/samsung/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 57e3378

Please sign in to comment.