If the allocation fails in amdgpu_dm_connector_funcs_reset() the
API cannot continue so trigger a BUG_ON.

Signed-off-by: Tom St Denis <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 58e29a2a5ca6..ac58ba4f10cf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2722,6 +2722,7 @@ void amdgpu_dm_connector_funcs_reset(struct drm_connector 
*connector)
        kfree(state);
 
        state = kzalloc(sizeof(*state), GFP_KERNEL);
+       BUG_ON(state == NULL);
 
        if (state) {
                state->scaling = RMX_OFF;
-- 
2.12.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to