From: Johan Hedberg Date: Mon, 16 Sep 2013 10:05:13 +0000 (+0300) Subject: Bluetooth: Fix double error response for l2cap_create_chan_req X-Git-Tag: accepted/tizen/common/20141203.182822~1141^2~225^2~24^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc280801da1006cd9c702cfaae7ae677fdbc5b53;p=platform%2Fkernel%2Flinux-arm64.git Bluetooth: Fix double error response for l2cap_create_chan_req When an L2CAP request handler returns non-zero the calling code will send a command reject response. The l2cap_create_chan_req function will in some cases send its own response but then still return a -EFAULT error which would cause two responses to be sent. This patch fixes this by making the function return 0 after sending its own response. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index b3bb7bc..0b8a270 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -4462,7 +4462,7 @@ error: l2cap_send_cmd(conn, cmd->ident, L2CAP_CREATE_CHAN_RSP, sizeof(rsp), &rsp); - return -EFAULT; + return 0; } static void l2cap_send_move_chan_req(struct l2cap_chan *chan, u8 dest_amp_id)