Bluetooth: Remove unneeded NULL check
Removing unneeded check makes code consistent since there is check only in one branch. Moreover since code is executed in tx_fiber frag cannot be NULL (result of bt_conn_create_pdu()). Change-Id: Id2f19279f604ad52019d9c334bc29641e4341037 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
7b3317bb54
commit
2382ab3db7
1 changed files with 2 additions and 4 deletions
|
@ -409,11 +409,9 @@ static struct net_buf *create_frag(struct bt_conn *conn, struct net_buf *buf)
|
||||||
uint16_t frag_len;
|
uint16_t frag_len;
|
||||||
|
|
||||||
frag = bt_conn_create_pdu(&frag_buf, 0);
|
frag = bt_conn_create_pdu(&frag_buf, 0);
|
||||||
if (conn->state != BT_CONN_CONNECTED) {
|
|
||||||
if (frag) {
|
|
||||||
net_buf_unref(frag);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (conn->state != BT_CONN_CONNECTED) {
|
||||||
|
net_buf_unref(frag);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue