diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-05-07 04:40:34 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-05-07 11:01:32 +0300 |
commit | e891e41ee301a57fc74a4a0d4da60fdc9669e50c (patch) | |
tree | e783ee2f7cd1c5a4617e339c195813da3ecb1595 /.get_maintainer.ignore | |
parent | ab42ddb9eb71b580349b03e4fc5bfcf230422eb8 (diff) | |
download | linux-e891e41ee301a57fc74a4a0d4da60fdc9669e50c.tar.xz |
dmaengine: sprd: Fix potential NULL dereference in sprd_dma_probe()
platform_get_resource() may fail and return NULL, so we should
better check it's return value to avoid a NULL pointer dereference
a bit later in the code.
This is detected by Coccinelle semantic patch.
@@
expression pdev, res, n, t, e, e1, e2;
@@
res = platform_get_resource(pdev, t, n);
+ if (!res)
+ return -EINVAL;
... when != res == NULL
e = devm_ioremap_nocache(e1, res->start, e2);
Fixes: 9b3b8171f7f4 ("dmaengine: sprd: Add Spreadtrum DMA driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to '.get_maintainer.ignore')
0 files changed, 0 insertions, 0 deletions