diff options
author | Thomas Zimmermann <[email protected]> | 2023-04-28 14:24:47 +0200 |
---|---|---|
committer | Thomas Zimmermann <[email protected]> | 2023-05-08 15:28:33 +0200 |
commit | 921b7383f34802726a7f45b6b38ef62bae0df4d6 (patch) | |
tree | 56a81c48db2873115d4fff0d118ff852cc08cf7f /drivers/fpga/fpga-mgr.c | |
parent | 254a4fda50590c5458f012220df3d0dc2f11fd6e (diff) |
fbdev: Return number of bytes read or written
Always return the number of bytes read or written within the
framebuffer. Only return an errno code if framebuffer memory
was not touched. This is the semantics required by POSIX and
makes fb_read() and fb_write() compatible with IGT tests. [1]
This bug has been fixed for fb_write() long ago by
commit 6a2a88668e90 ("[PATCH] fbdev: Fix return error of
fb_write"). The code in fb_read() and the corresponding fb_sys_()
helpers was forgotten.
It can happen that copy_{from, to}_user() only partially copies
the given buffer. Take this into account when calculating the
number of bytes.
v2:
* consider return value from copy_{from,to}_user() (Geert)
Signed-off-by: Thomas Zimmermann <[email protected]>
Tested-by: Sui Jingfeng <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Helge Deller <[email protected]>
Link: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/blob/master/tests/fbdev.c # 1
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions