diff options
Diffstat (limited to 'drivers/usb/misc/yurex.c')
-rw-r--r-- | drivers/usb/misc/yurex.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 343fa6ff9f4b..54e53ac4c08f 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -200,10 +200,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate memory for our device state and initialize it */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) { - dev_err(&interface->dev, "Out of memory\n"); + if (!dev) goto error; - } kref_init(&dev->kref); mutex_init(&dev->io_mutex); spin_lock_init(&dev->lock); @@ -231,17 +229,13 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate control URB */ dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!dev->cntl_urb) { - dev_err(&interface->dev, "Could not allocate control URB\n"); + if (!dev->cntl_urb) goto error; - } /* allocate buffer for control req */ dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); - if (!dev->cntl_req) { - dev_err(&interface->dev, "Could not allocate cntl_req\n"); + if (!dev->cntl_req) goto error; - } /* allocate buffer for control msg */ dev->cntl_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, @@ -269,10 +263,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ /* allocate interrupt URB */ dev->urb = usb_alloc_urb(0, GFP_KERNEL); - if (!dev->urb) { - dev_err(&interface->dev, "Could not allocate URB\n"); + if (!dev->urb) goto error; - } /* allocate buffer for interrupt in */ dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, |