bluetooth:Fix variable assignment for switch case in the function a2mp_chan_recv_cb
Subsystems (4)
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
@@ -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
Marcel Holtmann
maintainerHi 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_rejfor the switch caseA2MP_COMMAND_REJas this function call can fail and thus callers ofa2mp_chan_recv_cbshould be signaled when this internal function call fails in order for them to handle this failure when calling the functiona2mp_chan_recv_cb.Signed-off-by Nicholas Krause <[email protected]>---
net/bluetooth/a2mp.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel