]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: fix a possible null pointer dereference
authorGong Yuanjun <ruc_gongyuanjun@163.com>
Tue, 17 May 2022 09:57:00 +0000 (17:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 May 2022 18:56:31 +0000 (14:56 -0400)
commit51d6457f76aac708dbf79600440bd9e187dcb5e3
tree3342cfaf631482c58b00a4600b60a52aadd550a8
parent7592ffc37d47b5146867b1ff5f0a8b31de432fd8
drm/radeon: fix a possible null pointer dereference

In radeon_fp_native_mode(), the return value of drm_mode_duplicate()
is assigned to mode, which will lead to a NULL pointer dereference
on failure of drm_mode_duplicate(). Add a check to avoid npd.

The failure status of drm_cvt_mode() on the other path is checked too.

Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_connectors.c