mesh: Fix segfault caused by re-enabling of HCI controller 30/234230/1
authorInga Stotland <inga.stotland@intel.com>
Fri, 15 May 2020 17:41:56 +0000 (10:41 -0700)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 22 May 2020 04:23:44 +0000 (09:53 +0530)
commit6d9e9d73e3023ee7333a8f94dfbc251d833b1d35
treeff95efac04e10f983aa4eaa2f1428cee558f2441
parent50878c77f02c64adc1374501c5bb8901e79fe3b6
mesh: Fix segfault caused by re-enabling of HCI controller

This fixes the crash that occurs when a controller used by bluetooth-meshd
is removed and then added back again.

Also, correctly restart scanning when the controller is re-enabled.

Backtrace:
0x00005618e754d040 in ?? ()
0x00005618e6e12d9a in io_ready_callback () at mesh/mesh.c:174
0x00005618e6e3d2c8 in l_queue_foreach () at ell/queue.c:441
0x00005618e6e37927 in request_complete () at src/shared/mgmt.c:261

Change-Id: I360e9b1e4c39898d8b3c695e58f03cb89cf8076e
Signed-off-by: Abhay Agarwal <ay.agarwal@samsung.com>
mesh/mesh-io-generic.c
mesh/mesh.c