mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 11:54:14 -04:00
Bluetooth: Fix error code in chan_alloc_skb_cb()
[ Upstream commit 72d061ee630d0dbb45c2920d8d19b3861c413e54 ]
The chan_alloc_skb_cb() function is supposed to return error pointers on
error. Returning NULL will lead to a NULL dereference.
Fixes: 6b8d4a6a03 ("Bluetooth: 6LoWPAN: Use connected oriented channel instead of fixed one")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2cf5228644
commit
b3d607e36f
1 changed files with 6 additions and 1 deletions
|
|
@ -847,11 +847,16 @@ static struct sk_buff *chan_alloc_skb_cb(struct l2cap_chan *chan,
|
|||
unsigned long hdr_len,
|
||||
unsigned long len, int nb)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
|
||||
/* Note that we must allocate using GFP_ATOMIC here as
|
||||
* this function is called originally from netdev hard xmit
|
||||
* function in atomic context.
|
||||
*/
|
||||
return bt_skb_alloc(hdr_len + len, GFP_ATOMIC);
|
||||
skb = bt_skb_alloc(hdr_len + len, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
return skb;
|
||||
}
|
||||
|
||||
static void chan_suspend_cb(struct l2cap_chan *chan)
|
||||
|
|
|
|||
Loading…
Reference in a new issue