]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitf7e66cefa4e1645e0d6360473eb8cc5c73937f8a
treea31477129dea76d890550fb5d2f2edde947701cc
parentdbb008736a8c113ef1e12b4e4b4351fac2a15ede
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: 19a9476fd513 ("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