aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/image/microtek.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 3038ed0700d3..8ccddf74534a 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -796,7 +796,7 @@ static int mts_usb_probe(struct usb_interface *intf,
796 796
797 new_desc->context.scsi_status = kmalloc(1, GFP_KERNEL); 797 new_desc->context.scsi_status = kmalloc(1, GFP_KERNEL);
798 if (!new_desc->context.scsi_status) 798 if (!new_desc->context.scsi_status)
799 goto out_kfree2; 799 goto out_free_urb;
800 800
801 new_desc->usb_dev = dev; 801 new_desc->usb_dev = dev;
802 new_desc->usb_intf = intf; 802 new_desc->usb_intf = intf;
@@ -822,18 +822,20 @@ static int mts_usb_probe(struct usb_interface *intf,
822 new_desc->host = scsi_host_alloc(&mts_scsi_host_template, 822 new_desc->host = scsi_host_alloc(&mts_scsi_host_template,
823 sizeof(new_desc)); 823 sizeof(new_desc));
824 if (!new_desc->host) 824 if (!new_desc->host)
825 goto out_free_urb; 825 goto out_kfree2;
826 826
827 new_desc->host->hostdata[0] = (unsigned long)new_desc; 827 new_desc->host->hostdata[0] = (unsigned long)new_desc;
828 if (scsi_add_host(new_desc->host, NULL)) { 828 if (scsi_add_host(new_desc->host, NULL)) {
829 err_retval = -EIO; 829 err_retval = -EIO;
830 goto out_free_urb; 830 goto out_host_put;
831 } 831 }
832 scsi_scan_host(new_desc->host); 832 scsi_scan_host(new_desc->host);
833 833
834 usb_set_intfdata(intf, new_desc); 834 usb_set_intfdata(intf, new_desc);
835 return 0; 835 return 0;
836 836
837 out_host_put:
838 scsi_host_put(new_desc->host);
837 out_kfree2: 839 out_kfree2:
838 kfree(new_desc->context.scsi_status); 840 kfree(new_desc->context.scsi_status);
839 out_free_urb: 841 out_free_urb: