]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: allow buffer wraparound in comedi_write()
authorIan Abbott <abbotti@mev.co.uk>
Wed, 18 Nov 2015 17:55:08 +0000 (17:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 23:58:54 +0000 (15:58 -0800)
commit80a3feeba91faccba59320f8c3f2a6e755386d05
treeac14634755e673dee2339ecb6d79cc27007a8878
parent0112f40003ac5561628fc729b70ec579a2633c6a
staging: comedi: allow buffer wraparound in comedi_write()

`comedi_write()` copies data from the user buffer to the acquisition
data buffer, which is cyclic, using a single call to `copy_from_user()`.
It currently avoids having to deal with wraparound of the cyclic buffer
by limiting the amount it copies (and the amount returned to the user).
Change it to deal with the wraparound using two calls to
`copy_from_user()` if necessary.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi_fops.c