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:
Andrei Emeltchenko 2016-01-04 15:07:10 +02:00 committed by Anas Nashif
commit 2382ab3db7

View file

@ -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;
} }