]> git.baikalelectronics.ru Git - kernel.git/commit
gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_pro...
authorJia-Ju Bai <baijiaju1990@gmail.com>
Mon, 29 Jul 2019 08:36:44 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 2 Aug 2019 15:30:38 +0000 (10:30 -0500)
commitafbd8766eb8ef5e6f498c2e402c2e144c1d74198
treefa46fcc6ca7d572aef45d1443c4f8dceedfad5c6
parent1bd0ffe4c51b680c94cc1d89b9201f5534430ca8
gpu: drm: radeon: Fix a possible null-pointer dereference in radeon_connector_set_property()

In radeon_connector_set_property(), there is an if statement on line 743
to check whether connector->encoder is NULL:
    if (connector->encoder)

When connector->encoder is NULL, it is used on line 755:
    if (connector->encoder->crtc)

Thus, a possible null-pointer dereference may occur.

To fix this bug, connector->encoder is checked before being used.

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_connectors.c