File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -3037,19 +3037,23 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
3037
3037
*/
3038
3038
if (!(hdev -> claimed & HID_CLAIMED_INPUT )) {
3039
3039
hid_err (hdev , "failed to claim input\n" );
3040
- hid_hw_stop ( hdev ) ;
3041
- return - ENODEV ;
3040
+ ret = - ENODEV ;
3041
+ goto err ;
3042
3042
}
3043
3043
3044
3044
if (sc -> quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4 )) {
3045
- if (!hid_is_usb (hdev ))
3046
- return - EINVAL ;
3045
+ if (!hid_is_usb (hdev )) {
3046
+ ret = - EINVAL ;
3047
+ goto err ;
3048
+ }
3047
3049
3048
3050
usbdev = to_usb_device (sc -> hdev -> dev .parent -> parent );
3049
3051
3050
3052
sc -> ghl_urb = usb_alloc_urb (0 , GFP_ATOMIC );
3051
- if (!sc -> ghl_urb )
3052
- return - ENOMEM ;
3053
+ if (!sc -> ghl_urb ) {
3054
+ ret = - ENOMEM ;
3055
+ goto err ;
3056
+ }
3053
3057
3054
3058
if (sc -> quirks & GHL_GUITAR_PS3WIIU )
3055
3059
ret = ghl_init_urb (sc , usbdev , ghl_ps3wiiu_magic_data ,
@@ -3059,7 +3063,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
3059
3063
ARRAY_SIZE (ghl_ps4_magic_data ));
3060
3064
if (ret ) {
3061
3065
hid_err (hdev , "error preparing URB\n" );
3062
- return ret ;
3066
+ goto err ;
3063
3067
}
3064
3068
3065
3069
timer_setup (& sc -> ghl_poke_timer , ghl_magic_poke , 0 );
@@ -3068,6 +3072,10 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
3068
3072
}
3069
3073
3070
3074
return ret ;
3075
+
3076
+ err :
3077
+ hid_hw_stop (hdev );
3078
+ return ret ;
3071
3079
}
3072
3080
3073
3081
static void sony_remove (struct hid_device * hdev )
You can’t perform that action at this time.
0 commit comments