Merge "USB: f_accessory: Fix NULL pointer dereference in acc_read()"
This commit is contained in:
commit
a8db147fc1
1 changed files with 2 additions and 2 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Reference in a new issue