drm/imx: imx-ldb: Check for null pointer after calling kmemdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 5 Jan 2022 07:47:29 +0000 (15:47 +0800)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 4 Apr 2022 07:37:41 +0000 (09:37 +0200)
commit8027a9ad9b3568c5eb49c968ad6c97f279d76730
treea31477129dea76d890550fb5d2f2edde947701cc
parent3123109284176b1532874591f7c81f3837bbdc17
drm/imx: imx-ldb: Check for null pointer after calling kmemdup

As the possible failure of the allocation, kmemdup() may return NULL
pointer.
Therefore, it should be better to check the return value of kmemdup()
and return error if fails.

Fixes: dc80d7038883 ("drm/imx-ldb: Add support to drm-bridge")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220105074729.2363657-1-jiasheng@iscas.ac.cn
drivers/gpu/drm/imx/imx-ldb.c