From: Chris Wilson Date: Wed, 14 Sep 2011 12:14:28 +0000 (+0200) Subject: drm/i915: Defend against userspace creating a gem object with size==0 X-Git-Tag: v3.2-rc1~135^2~2^2~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ffc02468145ac92b1b88896e0f18bd7bcd52591;p=pandora-kernel.git drm/i915: Defend against userspace creating a gem object with size==0 We currently only round up the userspace size to the next page. We assume that userspace hasn't made a mistake and requested a zero-length gem object and all through our internal code we then presume that every object is backed by at least a single page. Fix that oversight and report EINVAL back to userspace if they try to create a zero length object. [danvet: This fixes tests/gem_bad_length] Signed-off-by: Chris Wilson Signed-Off-by: Daniel Vetter Reviewed-by: Ben Widawsky Signed-off-by: Keith Packard --- Reading git-diff-tree failed