diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c index 109635a848887b6f617d61e5776213d922e0ece7..1fa4f705b0b4b41f73cfe4352be1d92a16b6bbe0 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;