From 5409c16e84b5b2f0122bc8fdf781d785bef59344 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 14 Mar 2014 14:38:08 +0100 Subject: [PATCH] android/hal-bluetooth: Fix passing uninitialized mode on init This fix following Valgrind report: Syscall param sendmsg(msg.msg_iov[1]) points to uninitialised byte(s) at 0x534823D: ??? (syscall-template.S:81) by 0x5F68689: hal_ipc_cmd (hal-ipc.c:357) by 0x5F6240B: init (hal-bluetooth.c:437) by 0x4128C0: setup_base (android-tester.c:2594) by 0x40DDE5: setup_callback (tester.c:380) by 0x50803B5: g_main_context_dispatch (in /lib/x86_64-linux-gnu/ libglib-2.0.so.0.3800.1) by 0x5080707: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1) by 0x5080B09: g_main_loop_run (in /lib/x86_64-linux-gnu/ libglib-2.0.so.0.3800.1) by 0x40EA0C: tester_run (tester.c:798) by 0x404475: main (android-tester.c:4864) Address 0x7ff0002b1 is on thread 1's stack --- android/hal-bluetooth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c index fcf02f697..4c4f32fa0 100644 --- a/android/hal-bluetooth.c +++ b/android/hal-bluetooth.c @@ -433,6 +433,7 @@ static int init(bt_callbacks_t *callbacks) } cmd.service_id = HAL_SERVICE_ID_BLUETOOTH; + cmd.mode = HAL_MODE_DEFAULT; status = hal_ipc_cmd(HAL_SERVICE_ID_CORE, HAL_OP_REGISTER_MODULE, sizeof(cmd), &cmd, NULL, NULL, NULL); -- 2.47.3