staging: emxx_udc: Add checks for dma_alloc_coherent()
authorYuan Can <yuancan@huawei.com>
Thu, 19 Jan 2023 08:31:19 +0000 (08:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:57:34 +0000 (13:57 +0100)
commit4be3213e9d798cbf1350a31dd7504e8573bc8709
tree207dd2027c67d3ae9f28a432db625441d45cb06c
parent6683327b51a601daba32900072349dfa1d4e8fea
staging: emxx_udc: Add checks for dma_alloc_coherent()

[ Upstream commit f6510a93cfd8c6c79b4dda0f2967cdc6df42eff4 ]

As the dma_alloc_coherent may return NULL, the return value needs to be
checked to avoid NULL poineter dereference.

Signed-off-by: Yuan Can <yuancan@huawei.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Link: https://lore.kernel.org/r/20230119083119.16956-1-yuancan@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/emxx_udc/emxx_udc.c