USB: f_fs: Add print message in case of error scenario
Add print message in case of error scenarios which will be useful for debugging adb offline issues. Change-Id: I75bc136eab05151abb187c1fa1e5956b6f507297 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Mayank Rana <mrana@codeaurora.org>
This commit is contained in:
parent
32abf3b67f
commit
9d89a6599d
1 changed files with 14 additions and 3 deletions
|
@ -889,9 +889,20 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
spin_unlock_irq(&epfile->ffs->eps_lock);
|
spin_unlock_irq(&epfile->ffs->eps_lock);
|
||||||
if (io_data->read && ret > 0) {
|
if (io_data->read && ret > 0) {
|
||||||
ret = copy_to_iter(data, ret, &io_data->data);
|
|
||||||
if (!ret)
|
if (ret > data_len) {
|
||||||
ret = -EFAULT;
|
ret = -EOVERFLOW;
|
||||||
|
pr_err("More data(%zd) received than intended length(%zu)\n",
|
||||||
|
ret, data_len);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ret = copy_to_iter(data, ret, &io_data->data);
|
||||||
|
pr_debug("copied (%zd) bytes to user space\n", ret);
|
||||||
|
if (!ret) {
|
||||||
|
pr_err("Fail to copy to user\n");
|
||||||
|
ret = -EFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kfree(data);
|
kfree(data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue