summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/adutux.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-02-02 12:51:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-03 10:05:10 +0100
commit453785c64e090d9b4169636b7276fcd6d7489d33 (patch)
treef5788a91de5c24eabafea96a8f13487a72a2ec94 /drivers/usb/misc/adutux.c
parentMerge tag 'phy-for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/kis... (diff)
downloadlinux-453785c64e090d9b4169636b7276fcd6d7489d33.tar.xz
linux-453785c64e090d9b4169636b7276fcd6d7489d33.zip
usb: misc: adutux: remove redundant error check on copy_to_user return code
The 2nd check for a non-zero return from copy_to_user is redundant as it is has already been made a few lines earlier. This check was made redundant because of previous fix to the copy_to_user error return check. Detected by CoverityScan, CID#114347 ("Logically Dead Code") Fixes: 1865a9c382ede ("USB: adutux: fix misuse of return value of copy_to_user()") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/adutux.c')
-rw-r--r--drivers/usb/misc/adutux.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index 564268fca07a..a540e4f206c4 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -389,10 +389,6 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,
dev->secondary_head += (amount - i);
bytes_read += (amount - i);
bytes_to_read -= (amount - i);
- if (i) {
- retval = bytes_read ? bytes_read : -EFAULT;
- goto exit;
- }
} else {
/* we check the primary buffer */
spin_lock_irqsave (&dev->buflock, flags);