Ville Syrjälä 9ad6d99f18 drm/i915: Make i915_pipe_crc_read() oops proof
Currently i915_pipe_crc_read() will drop pipe_crc->lock for the entire
duration of the copy_to_user() loop, which means it'll access
pipe_crc->entries without any protection. If another thread sneaks in
and frees pipe_crc->entries the code will oops.

Reorganize the code to hold the lock around everything except
copy_to_user(). After the copy the lock is reacquired and the the number
of available entries is rechecked.

Since this is a debug feature simplify the error handling a bit by
consuming the crc entry even if copy_to_user() would fail.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-12-10 17:47:26 +01:00
..
2014-11-25 19:43:29 +03:00
2014-11-20 11:27:31 +10:00
2014-12-02 10:58:33 +10:00
2014-11-26 20:09:40 +02:00
2014-11-20 11:30:37 +10:00
2014-12-02 10:58:33 +10:00
2014-12-02 10:58:33 +10:00
2014-09-24 11:43:41 +10:00
2014-11-20 11:33:51 +10:00
2014-09-12 11:19:47 +02:00
2014-11-12 17:56:12 +10:00
2014-09-10 17:43:10 +10:00