diff options
author | Ethan Chen <intervigil@gmail.com> | 2016-06-20 12:04:10 -0700 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2016-06-21 09:28:30 -0700 |
commit | 0af4949c92fa6a3d260a6e5e81004f36e443095c (patch) | |
tree | 15160aee1d1b8c0f461d62eae6fcfee8f3b0d104 | |
parent | 5365992252898f1653a2977ae89702c992d4858f (diff) | |
download | android_system_bt-0af4949c92fa6a3d260a6e5e81004f36e443095c.tar.gz android_system_bt-0af4949c92fa6a3d260a6e5e81004f36e443095c.tar.bz2 android_system_bt-0af4949c92fa6a3d260a6e5e81004f36e443095c.zip |
bt-vendor: Check for vendor SSR function before attempting to call it
* Non-Qualcomm vendors may not have actually implemented this method,
even though they may have allocated the proper structure size.
Change-Id: I6094f0307ae2453fa53412a160a0c3e65e2f39cd
-rw-r--r-- | hci/src/vendor.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hci/src/vendor.c b/hci/src/vendor.c index 6cf14c19e..d08397e3d 100644 --- a/hci/src/vendor.c +++ b/hci/src/vendor.c @@ -93,8 +93,9 @@ void vendor_ssrcleanup(int reason) { /* This is horrible. Not all implementations have this method (from ours, * only 8992 appears to have it), so never try to call this on vendor * libraries without a "complete" interface (since this is the last one) */ - if (lib_interface && lib_interface->size >= - (sizeof(bt_vendor_interface_t))) + if (lib_interface && + lib_interface->size >= sizeof(bt_vendor_interface_t) && + lib_interface->ssr_cleanup) lib_interface->ssr_cleanup(reason); else LOG_ERROR("%s lib_interface is NULL", __func__); |