diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-05-09 14:37:45 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2019-05-13 20:23:45 +0300 |
commit | 66cab3c8674a7929e521b8effd76fdc9dc5da33f (patch) | |
tree | 66b0a01e1bcf16d9f491a11c2075c37f56f7436c /android | |
parent | 3775d077acab5d057eb4b12eb0271f647a036753 (diff) | |
download | bluez-66cab3c8674a7929e521b8effd76fdc9dc5da33f.tar.gz |
android/hal-bluetooth: Fix unaligned struct access
android/hal-bluetooth.c: In function ‘set_adapter_property’:
android/hal-bluetooth.c:659:46: error: taking address of packed member of ‘struct hal_cmd_set_adapter_prop’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
659 | adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val);
| ^~~~~~~~~
Diffstat (limited to 'android')
-rw-r--r-- | android/hal-bluetooth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index f22801b04..ee3a5e054 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -649,6 +649,7 @@ static int set_adapter_property(const bt_property_t *property) { char buf[IPC_MTU]; struct hal_cmd_set_adapter_prop *cmd = (void *) buf; + uint16_t len_ret; size_t len; DBG("prop: %s", btproperty2str(property)); @@ -656,8 +657,9 @@ static int set_adapter_property(const bt_property_t *property) if (!interface_ready()) return BT_STATUS_NOT_READY; - adapter_prop_from_hal(property, &cmd->type, &cmd->len, cmd->val); + adapter_prop_from_hal(property, &cmd->type, &len_ret, cmd->val); + cmd->len = len_ret; len = sizeof(*cmd) + cmd->len; return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_SET_ADAPTER_PROP, |