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:55:34 +0000 (13:55 +0100)
commit3c8dce696a660a3d704add7e11c9987dd6649eca
tree9a19987e67bd24e0522f83d827348fcb2e412ac8
parent2f588d0345d69a35e451077afed428fd057a5e34
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