Skip to content

Commit

Permalink
drm/vkms: Fix plane duplicate_state
Browse files Browse the repository at this point in the history
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: syzbot+eb6e5365f23c02517dda@syzkaller.appspotmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Gustavo Padovan <gustavo.padovan@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181128101033.4840-1-daniel.vetter@ffwll.ch
  • Loading branch information
Daniel Vetter committed Nov 29, 2018
1 parent 45fdfdb commit 7cdf33a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/gpu/drm/vkms/vkms_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7cdf33a

Please sign in to comment.