提交 2e2c682b 编写于 作者: S Sachin Kamat 提交者: Vinod Koul

DMA: PL330: Fix potential NULL pointer dereference in pl330_submit_req()

'r->cfg' is being checked for NULL. However, it is dereferenced
in the previous statements. Thus moving those statements within
the check.
Signed-off-by: NSachin Kamat <sachin.kamat@linaro.org>
Acked-by: NJassi Brar <jassisinghbrar@gmail.com>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
上级 c4567976
...@@ -1567,17 +1567,19 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r) ...@@ -1567,17 +1567,19 @@ static int pl330_submit_req(void *ch_id, struct pl330_req *r)
goto xfer_exit; goto xfer_exit;
} }
/* Prefer Secure Channel */
if (!_manager_ns(thrd))
r->cfg->nonsecure = 0;
else
r->cfg->nonsecure = 1;
/* Use last settings, if not provided */ /* Use last settings, if not provided */
if (r->cfg) if (r->cfg) {
/* Prefer Secure Channel */
if (!_manager_ns(thrd))
r->cfg->nonsecure = 0;
else
r->cfg->nonsecure = 1;
ccr = _prepare_ccr(r->cfg); ccr = _prepare_ccr(r->cfg);
else } else {
ccr = readl(regs + CC(thrd->id)); ccr = readl(regs + CC(thrd->id));
}
/* If this req doesn't have valid xfer settings */ /* If this req doesn't have valid xfer settings */
if (!_is_valid(ccr)) { if (!_is_valid(ccr)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册