diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-05-09 14:37:46 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2019-05-13 20:23:48 +0300 |
commit | 1b571bc3fc74897fe78bb9a07f5f1be94fea2134 (patch) | |
tree | f2021d9c2016dee0bdf2b125a5d0746e8f2ae685 /android | |
parent | 66cab3c8674a7929e521b8effd76fdc9dc5da33f (diff) | |
download | bluez-1b571bc3fc74897fe78bb9a07f5f1be94fea2134.tar.gz |
android/handsfree: Fix unaligned struct access
android/handsfree.c: In function ‘bt_sco_get_fd’:
android/handsfree.c:2913:47: error: taking address of packed member of ‘struct sco_rsp_get_fd’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
2913 | if (!dev || !bt_sco_get_fd_and_mtu(sco, &fd, &rsp.mtu))
| ^~~~~~~~
Diffstat (limited to 'android')
-rw-r--r-- | android/handsfree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/android/handsfree.c b/android/handsfree.c index cb348ab9f..ebe03728e 100644 --- a/android/handsfree.c +++ b/android/handsfree.c @@ -2903,6 +2903,7 @@ static void bt_sco_get_fd(const void *buf, uint16_t len) struct sco_rsp_get_fd rsp; struct hf_device *dev; bdaddr_t bdaddr; + uint16_t mtu; int fd; DBG(""); @@ -2910,9 +2911,10 @@ static void bt_sco_get_fd(const void *buf, uint16_t len) android2bdaddr(cmd->bdaddr, &bdaddr); dev = find_device(&bdaddr); - if (!dev || !bt_sco_get_fd_and_mtu(sco, &fd, &rsp.mtu)) + if (!dev || !bt_sco_get_fd_and_mtu(sco, &fd, &mtu)) goto failed; + rsp.mtu = mtu; DBG("fd %d mtu %u", fd, rsp.mtu); ipc_send_rsp_full(sco_ipc, SCO_SERVICE_ID, SCO_OP_GET_FD, |