Skip to content

Commit

Permalink
[BLUETOOTH] sco: Possible double free.
Browse files Browse the repository at this point in the history
this fixes coverity bug id #1068.
hci_send_sco() frees skb if (skb->len > hdev->sco_mtu).
Since it returns a negative error value only in this case, we
can directly return here.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
SesterhennEric authored and David S. Miller committed Apr 10, 2006
1 parent ad96b48 commit cdee575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/sco.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
}

if ((err = hci_send_sco(conn->hcon, skb)) < 0)
goto fail;
return err;

return count;

Expand Down

0 comments on commit cdee575

Please sign in to comment.