Bluetooth: Fix error return value on sendmsg.
authorJoão Paulo Rechi Vita <jprvita@profusion.mobi>
Tue, 22 Jun 2010 16:56:24 +0000 (13:56 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 21 Jul 2010 17:39:10 +0000 (10:39 -0700)
When we try to send a message bigger than the outgoing MTU value
EMSGSIZE (message too long) should be returned.

Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/l2cap.c

index 33e134b..884b840 100644 (file)
@@ -1827,7 +1827,7 @@ static int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct ms
        case L2CAP_MODE_BASIC:
                /* Check outgoing MTU */
                if (len > pi->omtu) {
-                       err = -EINVAL;
+                       err = -EMSGSIZE;
                        goto done;
                }