In the AIO path, if allocating of a request failse, the function simply
goes to the error_lock path whose end result is returning value of ret.
However, at this point ret’s value is zero (assigned as return value from
ffs_mutex_lock).
Fix by adding ‘ret = -ENOMEM’ statement.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
if (io_data->aio) {
req = usb_ep_alloc_request(ep->ep, GFP_KERNEL);
- if (unlikely(!req))
+ if (unlikely(!req)) {
+ ret = -ENOMEM;
goto error_lock;
+ }
req->buf = data;
req->length = data_len;