]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:12:01 +0000 (18:12 +0200)
commit28fd384c78d7d8ed8af0d086d778c3e438ba7f60
treee131dc51164872fc81980a03339f389eeb001b96
parent9223144fdd64582d61edab35fee7174135ef2fad
drm/radeon: fix a possible null pointer dereference

[ Upstream commit a2b28708b645c5632dc93669ab06e97874c8244f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/radeon/radeon_connectors.c