The ci_req->hw_buf can be NULL, test whether it is and if so,
avoid accessing it. Else, the system may crash.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Peter Chen <peter.chen@nxp.com>
Cc: Li Jun <jun.li@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
flush:
hwaddr = (unsigned long)ci_req->hw_buf;
+ if (!hwaddr)
+ return 0;
+
aligned_used_len = roundup(req->length, ARCH_DMA_MINALIGN);
flush_dcache_range(hwaddr, hwaddr + aligned_used_len);
unsigned long hwaddr = (unsigned long)ci_req->hw_buf;
uint32_t aligned_used_len;
- if (in)
+ if (in || !hwaddr)
return;
aligned_used_len = roundup(req->actual, ARCH_DMA_MINALIGN);