Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix skb allocation check for A2MP
@ 2012-12-22  3:22 Gustavo Padovan
  2014-03-07 18:12 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Padovan @ 2012-12-22  3:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

vtable's method alloc_skb() needs to return a ERR_PTR in case of err and
not a NULL.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 net/bluetooth/a2mp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index 0a2ec84..cd9410c 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -693,7 +693,13 @@ static void a2mp_chan_state_change_cb(struct l2cap_chan *chan, int state, int er
 static struct sk_buff *a2mp_chan_alloc_skb_cb(struct l2cap_chan *chan,
 					      unsigned long len, int nb)
 {
-	return bt_skb_alloc(len, GFP_KERNEL);
+	struct sk_buff *skb;
+
+	skb = bt_skb_alloc(len, GFP_KERNEL);
+	if (!skb)
+		return ERR_PTR(-ENOMEM);
+
+	return skb;
 }
 
 static struct l2cap_ops a2mp_chan_ops = {
-- 
1.8.0.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Fix skb allocation check for A2MP
  2012-12-22  3:22 [PATCH] Bluetooth: Fix skb allocation check for A2MP Gustavo Padovan
@ 2014-03-07 18:12 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-03-07 18:12 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: linux-bluetooth, Gustavo Padovan

Hi Gustavo,

On Sat, Dec 22, 2012, Gustavo Padovan wrote:
> vtable's method alloc_skb() needs to return a ERR_PTR in case of err and
> not a NULL.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> ---
>  net/bluetooth/a2mp.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

Applied to bluetooth-next. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-07 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-22  3:22 [PATCH] Bluetooth: Fix skb allocation check for A2MP Gustavo Padovan
2014-03-07 18:12 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox