Skip to contentSkip to conversation

switchtec: fix some error codes

PATCH In review Dan Carpenter 1 participant 1 message Mar 13, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 switchtec: fix some error codes

We shouldn't be changing these negative error codes to positive.

Fixes dbdb73b1e2c0 ("MicroSemi Switchtec management interface driver")
drivers/pci/switch/switchtec.c +3 -3
index 82ae08956457..fcde98161d9a 100644
@@ -656,7 +656,7 @@ static ssize_t switchtec_dev_write(struct file *filp, const char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_IDLE) {
 		rc = -EBADE;
@@ -700,7 +700,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state = MRPC_IDLE) {
 		mutex_unlock(&stdev->mrpc_mutex);
@@ -722,7 +722,7 @@ static ssize_t switchtec_dev_read(struct file *filp, char __user *data,
 
 	rc = lock_mutex_and_test_alive(stdev);
 	if (rc)
-		return -rc;
+		return rc;
 
 	if (stuser->state != MRPC_DONE) {
 		mutex_unlock(&stdev->mrpc_mutex);