CHROMIUM: bluetooth/sco - Check for NULL socket in receiving sco data

When recv_scodata is called, the hci_conn may actually hold a NULL
sock hence accessing the settings of sco_pinfo causes crash.

Fix this by moving the hci_conn socket NULL check earlier, to make
sure we access valid sco_pinfo settings before taking care of HCI SCO
header and call to sco_recv_frame.

BUG=chromium:980454
TEST=Repeatedly stress wideband speech with BT headset, verify
kernel doesn't crash.

Change-Id: Ibe91a46964919507c2c8db2788567a86ce600819
Signed-off-by: Hsin-Yu Chao <hychao@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1718629
Tested-by: Hsinyu Chao <hychao@chromium.org>
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
1 file changed