diff options
Diffstat (limited to 'drivers/mmc/host/ushc.c')
-rw-r--r-- | drivers/mmc/host/ushc.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c index b4ead4a13c98..f8f65df9b017 100644 --- a/drivers/mmc/host/ushc.c +++ b/drivers/mmc/host/ushc.c | |||
@@ -425,7 +425,7 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
425 | struct usb_device *usb_dev = interface_to_usbdev(intf); | 425 | struct usb_device *usb_dev = interface_to_usbdev(intf); |
426 | struct mmc_host *mmc; | 426 | struct mmc_host *mmc; |
427 | struct ushc_data *ushc; | 427 | struct ushc_data *ushc; |
428 | int ret = -ENOMEM; | 428 | int ret; |
429 | 429 | ||
430 | mmc = mmc_alloc_host(sizeof(struct ushc_data), &intf->dev); | 430 | mmc = mmc_alloc_host(sizeof(struct ushc_data), &intf->dev); |
431 | if (mmc == NULL) | 431 | if (mmc == NULL) |
@@ -462,11 +462,15 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
462 | mmc->max_blk_count = 511; | 462 | mmc->max_blk_count = 511; |
463 | 463 | ||
464 | ushc->int_urb = usb_alloc_urb(0, GFP_KERNEL); | 464 | ushc->int_urb = usb_alloc_urb(0, GFP_KERNEL); |
465 | if (ushc->int_urb == NULL) | 465 | if (ushc->int_urb == NULL) { |
466 | ret = -ENOMEM; | ||
466 | goto err; | 467 | goto err; |
468 | } | ||
467 | ushc->int_data = kzalloc(sizeof(struct ushc_int_data), GFP_KERNEL); | 469 | ushc->int_data = kzalloc(sizeof(struct ushc_int_data), GFP_KERNEL); |
468 | if (ushc->int_data == NULL) | 470 | if (ushc->int_data == NULL) { |
471 | ret = -ENOMEM; | ||
469 | goto err; | 472 | goto err; |
473 | } | ||
470 | usb_fill_int_urb(ushc->int_urb, ushc->usb_dev, | 474 | usb_fill_int_urb(ushc->int_urb, ushc->usb_dev, |
471 | usb_rcvintpipe(usb_dev, | 475 | usb_rcvintpipe(usb_dev, |
472 | intf->cur_altsetting->endpoint[0].desc.bEndpointAddress), | 476 | intf->cur_altsetting->endpoint[0].desc.bEndpointAddress), |
@@ -475,11 +479,15 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
475 | intf->cur_altsetting->endpoint[0].desc.bInterval); | 479 | intf->cur_altsetting->endpoint[0].desc.bInterval); |
476 | 480 | ||
477 | ushc->cbw_urb = usb_alloc_urb(0, GFP_KERNEL); | 481 | ushc->cbw_urb = usb_alloc_urb(0, GFP_KERNEL); |
478 | if (ushc->cbw_urb == NULL) | 482 | if (ushc->cbw_urb == NULL) { |
483 | ret = -ENOMEM; | ||
479 | goto err; | 484 | goto err; |
485 | } | ||
480 | ushc->cbw = kzalloc(sizeof(struct ushc_cbw), GFP_KERNEL); | 486 | ushc->cbw = kzalloc(sizeof(struct ushc_cbw), GFP_KERNEL); |
481 | if (ushc->cbw == NULL) | 487 | if (ushc->cbw == NULL) { |
488 | ret = -ENOMEM; | ||
482 | goto err; | 489 | goto err; |
490 | } | ||
483 | ushc->cbw->signature = USHC_CBW_SIGNATURE; | 491 | ushc->cbw->signature = USHC_CBW_SIGNATURE; |
484 | 492 | ||
485 | usb_fill_bulk_urb(ushc->cbw_urb, ushc->usb_dev, usb_sndbulkpipe(usb_dev, 2), | 493 | usb_fill_bulk_urb(ushc->cbw_urb, ushc->usb_dev, usb_sndbulkpipe(usb_dev, 2), |
@@ -487,15 +495,21 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
487 | cbw_callback, ushc); | 495 | cbw_callback, ushc); |
488 | 496 | ||
489 | ushc->data_urb = usb_alloc_urb(0, GFP_KERNEL); | 497 | ushc->data_urb = usb_alloc_urb(0, GFP_KERNEL); |
490 | if (ushc->data_urb == NULL) | 498 | if (ushc->data_urb == NULL) { |
499 | ret = -ENOMEM; | ||
491 | goto err; | 500 | goto err; |
501 | } | ||
492 | 502 | ||
493 | ushc->csw_urb = usb_alloc_urb(0, GFP_KERNEL); | 503 | ushc->csw_urb = usb_alloc_urb(0, GFP_KERNEL); |
494 | if (ushc->csw_urb == NULL) | 504 | if (ushc->csw_urb == NULL) { |
505 | ret = -ENOMEM; | ||
495 | goto err; | 506 | goto err; |
507 | } | ||
496 | ushc->csw = kzalloc(sizeof(struct ushc_cbw), GFP_KERNEL); | 508 | ushc->csw = kzalloc(sizeof(struct ushc_cbw), GFP_KERNEL); |
497 | if (ushc->csw == NULL) | 509 | if (ushc->csw == NULL) { |
510 | ret = -ENOMEM; | ||
498 | goto err; | 511 | goto err; |
512 | } | ||
499 | usb_fill_bulk_urb(ushc->csw_urb, ushc->usb_dev, usb_rcvbulkpipe(usb_dev, 6), | 513 | usb_fill_bulk_urb(ushc->csw_urb, ushc->usb_dev, usb_rcvbulkpipe(usb_dev, 6), |
500 | ushc->csw, sizeof(struct ushc_csw), | 514 | ushc->csw, sizeof(struct ushc_csw), |
501 | csw_callback, ushc); | 515 | csw_callback, ushc); |