blob: 7b4eca690e8c8631167aa8bf4fc18311f87914e2 [file] [log] [blame]
From d11501825ee218016bbfc49cc55b983af30b8afa Mon Sep 17 00:00:00 2001
From: Colin Ian King <>
Date: Fri, 25 Oct 2019 15:33:39 +0200
Subject: [PATCH] media: flexcop-usb: ensure -EIO is returned on error
commit 74a96b51a36de4d86660fbc56b05d86668162d6b upstream.
An earlier commit hard coded a return 0 to function flexcop_usb_i2c_req
even though the an -EIO was intended to be returned in the case where
ret != buflen. Fix this by replacing the return 0 with the return of
ret to return the error return code.
Addresses-Coverity: ("Unused value")
Fixes: b430eaba0be5 ("[media] flexcop-usb: don't use stack for DMA")
Signed-off-by: Colin Ian King <>
Signed-off-by: Sean Young <>
Signed-off-by: Mauro Carvalho Chehab <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
index d1331f828108..039963a7765b 100644
--- a/drivers/media/usb/b2c2/flexcop-usb.c
+++ b/drivers/media/usb/b2c2/flexcop-usb.c
@@ -295,7 +295,7 @@ static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c,
- return 0;
+ return ret;
/* actual bus specific access functions,