OSDN Git Service

DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition
authorAndre Eisenbach <eisenbach@google.com>
Wed, 11 May 2016 03:27:20 +0000 (20:27 -0700)
committerZach Johnson <zachoverflow@google.com>
Wed, 11 May 2016 18:48:03 +0000 (18:48 +0000)
commitd7ec6c9c59aab205a1e90fd1db3f98431e983dfd
tree10a5e233f0cbbcf53ef5d1089e1b354de063e5e2
parentd266361dd4ea671c527fcddbe9377e7a801bcfee
DO NOT MERGE ANYWHERE Fix double mutex unlock and if() condition

Commit "L2CAP and SDP Search API for BT profiles (2/2)" introduced two
separate issues in btsock_rfc_signaled():

1. The "slot_lock" potentially gets unlocked twice, causing
   undefined behaviour.

2. The call to BTA_JvRfcommWrite() was incorrectly taken outside
   of the conditional if() block that only executes the code if
   data is available.

This patch reverts the relevant locking change and fixes the if()
condition.

Bug: 27204458
Change-Id: I63b1257d21ca7bdd248858ec67e28f64e37a7895
(cherry picked from commit 2d7ddd09c163c84eacddd101cf08fd8021a35370)
btif/src/btif_sock_rfc.c