Skip to contentSkip to conversation

drivers: fsi: occ: Fix errno for canceling a read operation

PATCH New Eddie James 1 participant 1 message Oct 12, 2017 FSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: fsi: occ: Fix errno for canceling a read operation

From: "Edward A. James" <[email protected]>

Should not return -ECANCELED when the device has been removed. Instead, use -ENODEV.

---
 drivers/fsi/occ.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/fsi/occ.c +3 -1
index 2e64ee2..1fe1a54 100644
@@ -240,8 +240,10 @@ static ssize_t occ_read_common(struct occ_client *client, char __user *ubuf,
 		spin_lock_irq(&client->lock);
 
 		if (!test_bit(XFR_COMPLETE, &xfr->flags)) {
-			if (occ->cancel || test_bit(XFR_CANCELED, &xfr->flags))
+			if (test_bit(XFR_CANCELED, &xfr->flags))
 				rc = -ECANCELED;
+			else if (occ->cancel)
+				rc = -ENODEV;
 			else
 				rc = -EINTR;
 
Signature · 1 line
1.8.3.1