From: João Paulo Rechi Vita Date: Tue, 22 Jun 2010 16:56:24 +0000 (-0300) Subject: Bluetooth: Fix error return value on sendmsg. X-Git-Tag: v2.6.36-rc1~571^2~64^2~48^2~24 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f9dd11b03c5c3cd6bdf2e503400bbc922c898974;p=~shefty%2Frdma-dev.git Bluetooth: Fix error return value on sendmsg. 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 Acked-by: Gustavo F. Padovan Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 33e134b0d40..884b840081a 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -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; }