Bluetooth: Host: Add "assert non-null" to bt_conn_ref
Clearly `conn` must be non-null since it's dereferenced without checks. Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This commit is contained in:
parent
a8f12ab690
commit
7e11b98125
|
@ -1120,6 +1120,8 @@ struct bt_conn *bt_conn_ref(struct bt_conn *conn)
|
|||
{
|
||||
atomic_val_t old;
|
||||
|
||||
__ASSERT_NO_MSG(conn);
|
||||
|
||||
/* Reference counter must be checked to avoid incrementing ref from
|
||||
* zero, then we should return NULL instead.
|
||||
* Loop on clear-and-set in case someone has modified the reference
|
||||
|
|
Loading…
Reference in a new issue