diff options
author | Daniel Vetter <[email protected]> | 2018-11-28 11:10:33 +0100 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2018-11-29 10:30:39 +0100 |
commit | 7cdf33ab02e01300e7e6289acbac9cd8759f8712 (patch) | |
tree | 2a71c1a6a286b660bf128e02a85b2d3514be66ae | |
parent | 45fdfdb6475905704134afba3c0ef5f24c2b5921 (diff) |
drm/vkms: Fix plane duplicate_state
We need to handle allocation failures and bail out. While at it, tune
the allocation failures down to debug level.
syzbot injected an allocation failure and then hit this WARN_ON.
Reported-by: [email protected]
Signed-off-by: Daniel Vetter <[email protected]>
Cc: Haneen Mohammed <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Rodrigo Siqueira <[email protected]>
Cc: Gustavo Padovan <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/vkms/vkms_plane.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c index 7041007396ae..e3bcea4b4891 100644 --- a/drivers/gpu/drm/vkms/vkms_plane.c +++ b/drivers/gpu/drm/vkms/vkms_plane.c @@ -23,8 +23,11 @@ vkms_plane_duplicate_state(struct drm_plane *plane) return NULL; crc_data = kzalloc(sizeof(*crc_data), GFP_KERNEL); - if (WARN_ON(!crc_data)) - DRM_INFO("Couldn't allocate crc_data"); + if (!crc_data) { + DRM_DEBUG_KMS("Couldn't allocate crc_data\n"); + kfree(vkms_state); + return NULL; + } vkms_state->crc_data = crc_data; |