File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -829,6 +829,7 @@ static struct usb_class_driver wdm_class = {
829
829
static int wdm_wwan_port_start (struct wwan_port * port )
830
830
{
831
831
struct wdm_device * desc = wwan_port_get_drvdata (port );
832
+ int rv ;
832
833
833
834
/* The interface is both exposed via the WWAN framework and as a
834
835
* legacy usbmisc chardev. If chardev is already open, just fail
@@ -848,7 +849,15 @@ static int wdm_wwan_port_start(struct wwan_port *port)
848
849
wwan_port_txon (port );
849
850
850
851
/* Start getting events */
851
- return usb_submit_urb (desc -> validity , GFP_KERNEL );
852
+ rv = usb_submit_urb (desc -> validity , GFP_KERNEL );
853
+ if (rv < 0 ) {
854
+ wwan_port_txoff (port );
855
+ desc -> manage_power (desc -> intf , 0 );
856
+ /* this must be last lest we race with chardev open */
857
+ clear_bit (WDM_WWAN_IN_USE , & desc -> flags );
858
+ }
859
+
860
+ return rv ;
852
861
}
853
862
854
863
static void wdm_wwan_port_stop (struct wwan_port * port )
You can’t perform that action at this time.
0 commit comments