summaryrefslogtreecommitdiff
path: root/drivers/misc/mei/amthif.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2014-03-12 13:19:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-17 15:53:28 -0700
commitdbac4745270bb8a8c5f119d21ce25764e9d7557d (patch)
tree3c0a5fa053eba76b030f9bd451f8b75321ddb264 /drivers/misc/mei/amthif.c
parent80260f2360d34912cd8cb18aca6eda20e9db2ef0 (diff)
downloadlinux-exynos-dbac4745270bb8a8c5f119d21ce25764e9d7557d.tar.gz
linux-exynos-dbac4745270bb8a8c5f119d21ce25764e9d7557d.tar.bz2
linux-exynos-dbac4745270bb8a8c5f119d21ce25764e9d7557d.zip
mei: report consistently copy_from/to_user failures
Consistently display error on possible copy_from/to_user failures use dev_dbg so it cannot be abused to flood the kernel log Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/amthif.c')
-rw-r--r--drivers/misc/mei/amthif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index b75a7da1ca84..2052609b167a 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -244,8 +244,10 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
* the buf_idx may point beyond */
length = min_t(size_t, length, (cb->buf_idx - *offset));
- if (copy_to_user(ubuf, cb->response_buffer.data + *offset, length))
+ if (copy_to_user(ubuf, cb->response_buffer.data + *offset, length)) {
+ dev_dbg(&dev->pdev->dev, "failed to copy data to userland\n");
rets = -EFAULT;
+ }
else {
rets = length;
if ((*offset + length) < cb->buf_idx) {