]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Always normalize return timeout for wait_timeout_ioctl
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 26 Apr 2013 13:22:46 +0000 (16:22 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 30 Apr 2013 08:50:32 +0000 (10:50 +0200)
commit74b4c22623b5056f0e1c1c9c1523b31a4c7520f2
treeb14bc686eb4ff669527d1763ffcda273e983f491
parent5bbef734535be4d279f0ad52f4865232e42c0b35
drm/i915: Always normalize return timeout for wait_timeout_ioctl

As we recompute the remaining timeout after waiting, there is a
potential for that timeout to be less than zero and so need sanitizing.
The timeout is always returned to userspace and validated, so we should
always perform the sanitation.

v2 [vsyrjala]: Only normalize the timespec if it's invalid
v3: Add a comment to clarify the situation and remove the now
    useless WARN_ON() (ickle)

Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c