Skip to contentSkip to conversation

bluetooth:Fix variable assignment for switch case in the function a2mp_chan_recv_cb

PATCH In review Nicholas Krause 2 participants 2 messages Aug 18, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth:Fix variable assignment for switch case in the function a2mp_chan_recv_cb

This fixes the issue with not assigning the variable err to the return value of the call to the function a2mp_command_rej for the switch case A2MP_COMMAND_REJ as this function call can fail and thus callers of a2mp_chan_recv_cb should be signaled when this internal function call fails in order for them to handle this failure when calling the function a2mp_chan_recv_cb.

---
 net/bluetooth/a2mp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/a2mp.c +1 -1
index 5a04eb1..5e1f240 100644
@@ -612,7 +612,7 @@ static int a2mp_chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
 
 		switch (hdr->code) {
 		case A2MP_COMMAND_REJ:
-			a2mp_command_rej(mgr, skb, hdr);
+			err = a2mp_command_rej(mgr, skb, hdr);
 			break;
 
 		case A2MP_DISCOVER_REQ:
Signature · 1 line
2.1.4
maintainer
#1 lore raw

Hi Nicholas,

Quoted 11 lines

This fixes the issue with not assigning the variable err to the return value of the call to the function a2mp_command_rej for the switch case A2MP_COMMAND_REJ as this function call can fail and thus callers of a2mp_chan_recv_cb should be signaled when this internal function call fails in order for them to handle this failure when calling the function a2mp_chan_recv_cb.

---
net/bluetooth/a2mp.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel