Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 127af882 authored by Eli Billauer's avatar Eli Billauer Committed by Greg Kroah-Hartman
Browse files

char: xillybus: Don't return -EFAULT on user-triggered flush



The API allows the application to flush a host-to-FPGA stream by calling
write() with the data count set to zero. Before this patch, copy_from_user()
was called with a non-zero byte count, which possibly made it attempt to read
from unmapped user memory. Such attempts caused the driver to return -EFAULT
instead of 0, even though the desired operation went through fine.

This patch ensures the driver returns 0 on a successful flush.

Signed-off-by: default avatarEli Billauer <eli.billauer@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be29bc2e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment