drm/radeon: fix a possible null pointer dereference
stable inclusion from stable-v5.10.122 commit fee8ae0a0bb66eb7730c22f44fbd7203f63c2eab category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fee8ae0a0bb66eb7730c22f44fbd7203f63c2eab -------------------------------- [ Upstream commit a2b28708 ] 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> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com> Reviewed-by:
Wei Li <liwei391@huawei.com>
Loading
Please sign in to comment