File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -631,15 +631,18 @@ static int rtsx_usb_probe(struct usb_interface *intf,
631
631
632
632
ucr -> pusb_dev = usb_dev ;
633
633
634
- ucr -> iobuf = kmalloc (IOBUF_SIZE , GFP_KERNEL );
635
- if (!ucr -> iobuf )
634
+ ucr -> cmd_buf = kmalloc (IOBUF_SIZE , GFP_KERNEL );
635
+ if (!ucr -> cmd_buf )
636
636
return - ENOMEM ;
637
637
638
+ ucr -> rsp_buf = kmalloc (IOBUF_SIZE , GFP_KERNEL );
639
+ if (!ucr -> rsp_buf )
640
+ goto out_free_cmd_buf ;
641
+
638
642
usb_set_intfdata (intf , ucr );
639
643
640
644
ucr -> vendor_id = id -> idVendor ;
641
645
ucr -> product_id = id -> idProduct ;
642
- ucr -> cmd_buf = ucr -> rsp_buf = ucr -> iobuf ;
643
646
644
647
mutex_init (& ucr -> dev_mutex );
645
648
@@ -667,9 +670,11 @@ static int rtsx_usb_probe(struct usb_interface *intf,
667
670
668
671
out_init_fail :
669
672
usb_set_intfdata (ucr -> pusb_intf , NULL );
670
- kfree (ucr -> iobuf );
671
- ucr -> iobuf = NULL ;
672
- ucr -> cmd_buf = ucr -> rsp_buf = NULL ;
673
+ kfree (ucr -> rsp_buf );
674
+ ucr -> rsp_buf = NULL ;
675
+ out_free_cmd_buf :
676
+ kfree (ucr -> cmd_buf );
677
+ ucr -> cmd_buf = NULL ;
673
678
return ret ;
674
679
}
675
680
@@ -682,9 +687,12 @@ static void rtsx_usb_disconnect(struct usb_interface *intf)
682
687
mfd_remove_devices (& intf -> dev );
683
688
684
689
usb_set_intfdata (ucr -> pusb_intf , NULL );
685
- kfree (ucr -> iobuf );
686
- ucr -> iobuf = NULL ;
687
- ucr -> cmd_buf = ucr -> rsp_buf = NULL ;
690
+
691
+ kfree (ucr -> cmd_buf );
692
+ ucr -> cmd_buf = NULL ;
693
+
694
+ kfree (ucr -> rsp_buf );
695
+ ucr -> rsp_buf = NULL ;
688
696
}
689
697
690
698
#ifdef CONFIG_PM
Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ struct rtsx_ucr {
54
54
struct usb_device * pusb_dev ;
55
55
struct usb_interface * pusb_intf ;
56
56
struct usb_sg_request current_sg ;
57
- unsigned char * iobuf ;
58
57
59
58
struct timer_list sg_timer ;
60
59
struct mutex dev_mutex ;
You can’t perform that action at this time.
0 commit comments