port-mbim: do not clear the progress flag until really finished opening
When the MBIM port open involved transparently trying to open a QMI device as well, we were clearing the progress flag before the full operation had finished, and so the port could have been closed by the time we really finish the open operation, leading to a crash: ModemManager[28824]: <info> [1547386038.726136] (usbmisc/cdc-wdm3): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <info> [1547386038.728084] (tty/ttyUSB0): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <info> [1547386038.728738] (tty/ttyUSB1): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <info> [1547386038.730769] (tty/ttyUSB2): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <info> [1547386038.731256] (tty/ttyUSB3): released by device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <debug> [1547386038.731301] Removing empty device '/sys/devices/pci0000:00/0000:00:1c.4/0000:02:00.0/usb3/3-2/3-2.3' ModemManager[28824]: <debug> [1547386038.731445] (ttyUSB0) forced to close port ModemManager[28824]: <debug> [1547386038.731547] (ttyUSB1) forced to close port ModemManager[28824]: <debug> [1547386038.731638] (ttyUSB2) forced to close port ModemManager[28824]: <debug> [1547386038.731715] (ttyUSB3) forced to close port ModemManager[28824]: <debug> [1547386039.580136] [cdc-wdm3] error: couldn't open QmiDevice: MBIM error: Transaction timed out ModemManager[28824]: <info> [1547386039.580190] [cdc-wdm3] MBIM device is not QMI capable ** ERROR:mm-broadband-modem-mbim.c:2119:track_mbim_device_removed: assertion failed: (device) Thread 1 "ModemManager" received signal SIGABRT, Aborted. 0x00007ffff7390d7f in raise () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff7390d7f in raise () at /usr/lib/libc.so.6 #1 0x00007ffff737b672 in abort () at /usr/lib/libc.so.6 #2 0x00007ffff7559042 in () at /usr/lib/libglib-2.0.so.0 #3 0x00007ffff75865dc in g_assertion_message_expr () at /usr/lib/libglib-2.0.so.0 #4 0x00005555556407f9 in track_mbim_device_removed (self=0x5555557a2830, mbim=0x5555557ea190) at mm-broadband-modem-mbim.c:2119 #5 0x000055555564093e in mbim_port_open_ready (mbim=0x5555557ea190, res=0x55555573fcf0, task=0x5555557d29d0) at mm-broadband-modem-mbim.c:2161 #6 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 #7 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 #8 0x000055555565fcd5 in qmi_device_open_ready (dev=0x55555578f250, res=0x55555573fb50, task=0x55555573fcf0) at mm-port-mbim.c:191 #9 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 #10 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 #11 0x00007ffff7c03fe6 in open_version_info_ready (client_ctl=0x7fffe8010c20, res=0x555555739e80, task=0x55555573fb50) at qmi-device.c:2050 #12 0x00007ffff77742f4 in () at /usr/lib/libgio-2.0.so.0 #13 0x00007ffff7776cd7 in () at /usr/lib/libgio-2.0.so.0 #14 0x00007ffff7c2034f in get_version_info_ready (device=0x55555578f250, res=0x5555557ea2a0, task=0x555555739e80) at qmi-ctl.c:3746 #15 0x00007ffff778ebcf in g_simple_async_result_complete () at /usr/lib/libgio-2.0.so.0 #16 0x00007ffff778ec5a in () at /usr/lib/libgio-2.0.so.0 #17 0x00007ffff75a98d1 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #18 0x00007ffff75ab5e9 in () at /usr/lib/libglib-2.0.so.0 #19 0x00007ffff75ac5c2 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0 #20 0x0000555555599eb0 in main (argc=2, argv=0x7fffffffe4c8) at main.c:181
Loading
Please register or sign in to comment