Merge "USB: f_accessory: Fix NULL pointer dereference in acc_read()"

This commit is contained in:
Linux Build Service Account 2016-09-17 21:07:17 -07:00 committed by Gerrit - the friendly Code Review server
commit a8db147fc1

View file

@ -629,8 +629,6 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
if (count > BULK_BUFFER_SIZE)
count = BULK_BUFFER_SIZE;
len = ALIGN(count, dev->ep_out->maxpacket);
/* we will block until we're online */
pr_debug("acc_read: waiting for online\n");
ret = wait_event_interruptible(dev->read_wq, dev->online);
@ -639,6 +637,8 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
goto done;
}
len = ALIGN(count, dev->ep_out->maxpacket);
if (dev->rx_done) {
// last req cancelled. try to get it.
req = dev->rx_req[0];