Bluetooth: Fix error return value on sendmsg.
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / l2cap.c
index 33e134b0d4023807a70600474016137f3bed82cc..884b840081ae59eceaadbc3a26839180cf7f7e5b 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;
                }