Bluetooth: L2CAP: Fix unnecessary NULL check
The segment allocation function can't fail (it eventually waits with K_FOREVER for a buffer to become available), so there's no point in checking its return value for NULL. Also, the connection state check is because of this particular waiting and not the semaphore waiting (which is done with K_NO_WAIT). Change-Id: I9698760541de810869cffc1c60cf97c5f8f7df8d Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
27bad8743f
commit
512d2ac433
1 changed files with 1 additions and 4 deletions
|
@ -1080,11 +1080,8 @@ static int l2cap_chan_le_send(struct bt_l2cap_le_chan *ch, struct net_buf *buf,
|
|||
}
|
||||
|
||||
buf = l2cap_chan_create_seg(ch, buf, sdu_hdr_len);
|
||||
if (!buf) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Channel may have been disconnected while waiting for credits */
|
||||
/* Channel may have been disconnected while waiting for a buffer */
|
||||
if (!ch->chan.conn) {
|
||||
net_buf_unref(buf);
|
||||
return -ECONNRESET;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue