Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Mosberger <davidm@egauge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (!max3421_ep) {
/* gets freed in max3421_endpoint_disable: */
max3421_ep = kzalloc(sizeof(struct max3421_ep), mem_flags);
- if (!max3421_ep)
- return -ENOMEM;
+ if (!max3421_ep) {
+ retval = -ENOMEM;
+ goto out;
+ }
max3421_ep->ep = urb->ep;
max3421_ep->last_active = max3421_hcd->frame_number;
urb->ep->hcpriv = max3421_ep;
wake_up_process(max3421_hcd->spi_thread);
}
+out:
spin_unlock_irqrestore(&max3421_hcd->lock, flags);
return retval;
}