drm/msm: Don't allow zero sized buffer objects
authorJordan Crouse <jcrouse@codeaurora.org>
Tue, 7 Mar 2017 17:02:51 +0000 (10:02 -0700)
committerRob Clark <robdclark@gmail.com>
Mon, 3 Apr 2017 20:09:35 +0000 (16:09 -0400)
commit1a5dff5d74e55608a9632a1d030bb79196e0755c
tree3a102ac1358739e9ae7e7b099a2ef5d5dc861f83
parentf456d348b6320a2597a3f1fff3ad0011c5678603
drm/msm: Don't allow zero sized buffer objects

Zero sized buffer objects tend to make various bits of the GEM
infrastructure complain:

 WARNING: CPU: 1 PID: 2323 at drivers/gpu/drm/drm_mm.c:389 drm_mm_insert_node_generic+0x258/0x2f0
 Modules linked in:

 CPU: 1 PID: 2323 Comm: drm-api-test Tainted: G        W 4.9.0-rc4-00906-g693af44 #213
 Hardware name: Qualcomm Technologies, Inc. DB820c (DT)
 task: ffff8000d7353400 task.stack: ffff8000d7720000
 PC is at drm_mm_insert_node_generic+0x258/0x2f0
 LR is at drm_vma_offset_add+0x4c/0x70

Zero sized buffers serve no appreciable value to the user so disallow
them at create time.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_gem.c