Skip to contentSkip to conversation

Possible double free in net/bluetooth/sco.c

PATCH In review Eric Sesterhenn 2 participants 2 messages Apr 4, 2006 – Apr 6, 2006 Bluetooth

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Possible double free in net/bluetooth/sco.c

hi,

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.

net/bluetooth/sco.c renamed from net/bluetooth/sco.c.orig +1 -1
@@ -255,7 +255,7 @@ static inline int sco_send_frame(struct 
 	}
 
 	if ((err = hci_send_sco(conn->hcon, skb)) < 0)
-		goto fail;
+		return err;
 
 	return count;
 
#1 lore raw

From: Eric Sesterhenn <[email protected]>
Date: Tue, 04 Apr 2006 21:25:18 +0200

Quoted 6 lines

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.

This looks fine, applied.

Thanks.