[PATCH 33/34] Bluetooth: Clean sco_send_frame() flow

Gustavo F. Padovan
2010-04-01T20:23:51Z

net/bluetooth/sco.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 50a9af8..1dc7856 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -245,17 +245,13 @@ static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
return err;

if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
- err = -EFAULT;
- goto fail;
+ kfree_skb(skb);
+ return -EFAULT;
}

hci_send_sco(conn->hcon, skb);

return count;
-
-fail:
- kfree_skb(skb);
- return err;
}

static inline void sco_recv_frame(struct sco_conn *conn, struct sk_buff *skb)
--
1.6.4.4