summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/storage_common.c
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2011-04-14 11:55:43 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-29 17:24:36 -0700
commitfd4477b09e13f60c7d9e497311ea6410a94aaae8 (patch)
tree01137169557a7433f3ddcbcb6b00d61c0d61f700 /drivers/usb/gadget/storage_common.c
parent865835fa441fcabc65251f14280df3055fe82d0f (diff)
downloadlinux-fd4477b09e13f60c7d9e497311ea6410a94aaae8.tar.gz
linux-fd4477b09e13f60c7d9e497311ea6410a94aaae8.tar.bz2
linux-fd4477b09e13f60c7d9e497311ea6410a94aaae8.zip
usb: gadget: storage_common: use kstrto*() [bug fix]
This commit fixes an embarrassing bug in the "storage_common: use kstrto*()" patch which caused fsg_store_ro() to return zero instead of the length of the consumed buffer. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/storage_common.c')
-rw-r--r--drivers/usb/gadget/storage_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
index 109635a84888..1fa4f705b0b4 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -708,7 +708,7 @@ static ssize_t fsg_show_file(struct device *dev, struct device_attribute *attr,
static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
- ssize_t rc = count;
+ ssize_t rc;
struct fsg_lun *curlun = fsg_lun_from_dev(dev);
struct rw_semaphore *filesem = dev_get_drvdata(dev);
unsigned ro;
@@ -729,6 +729,7 @@ static ssize_t fsg_store_ro(struct device *dev, struct device_attribute *attr,
curlun->ro = ro;
curlun->initially_ro = ro;
LDBG(curlun, "read-only status set to %d\n", curlun->ro);
+ rc = count;
}
up_read(filesem);
return rc;