aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 07be62bbaae..55200e4fdf1 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -266,8 +266,6 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf,
lun = simple_strtoul(p + 1, &p, 0);
err = scsi_add_single_device(host, channel, id, lun);
- if (err >= 0)
- err = length;
/*
* Usage: echo "scsi remove-single-device 0 1 2 3" >/proc/scsi/scsi
@@ -284,6 +282,13 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf,
err = scsi_remove_single_device(host, channel, id, lun);
}
+ /*
+ * convert success returns so that we return the
+ * number of bytes consumed.
+ */
+ if (!err)
+ err = length;
+
out:
free_page((unsigned long)buffer);
return err;