Bluetooth: Controller: Fix incorrect auto variable init

Coverity analysis discovered NULL pointer being
dereferenced when passing a auto variable. The variable is
now correctly assigned with address of a valid default
value variable. As per design, the dereferencing will not
happen as the master role does not use the passed parameter
only slave role uses it to prepare the connection parameter
request PDU.

Change-id: I3f8519b23a83cb8c50c7fba81810eff7737ff74a
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
This commit is contained in:
Vinayak Chettimada 2016-11-15 17:00:32 +01:00 committed by Johan Hedberg
commit 94a425429c

View file

@ -3287,9 +3287,12 @@ static void sched_free_win_offset_calc(struct connection *conn_curr,
static void work_sched_free_win_offset_calc(void *params)
{
struct connection *conn = (struct connection *)params;
uint32_t *ticks_to_offset_next = 0;
uint32_t ticks_to_offset_default = 0;
uint32_t *ticks_to_offset_next;
uint8_t offset_max = 6;
ticks_to_offset_next = &ticks_to_offset_default;
if (conn->role.slave.role != 0) {
conn->llcp.connection_update.ticks_to_offset_next =
conn->role.slave.ticks_to_offset;