Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63bae08e authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Rectify allocation of GATT control block

This change ensures that a valid value is returned while
requesting available control block or allocating memory
for a new control block for saving GATT discovery handles.
The bug if not fixed causes memory corruption and thus
modifying some callback handles.

Change-Id: I148ee82d2ea9fe77bebd34fd345b4fb6a6eee3cd
parent 31446d17
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_conn_id(UINT16 conn_id)
            return p_clcb;
    }

    return p_clcb;
    return NULL;
}

/*******************************************************************************
@@ -122,7 +122,7 @@ static tGATT_PROFILE_CLCB *gatt_profile_find_clcb_by_bd_addr(BD_ADDR bda, tBT_TR
            return p_clcb;
    }

    return p_clcb;
    return NULL;
}

/*******************************************************************************
@@ -151,7 +151,10 @@ tGATT_PROFILE_CLCB *gatt_profile_clcb_alloc (UINT16 conn_id, BD_ADDR bda, tBT_TR
            break;
        }
    }
    if(i_clcb < GATT_MAX_APPS)
        return p_clcb;

    return NULL;
}

/*******************************************************************************