From: Luiz Augusto von Dentz Date: Mon, 15 Aug 2016 13:02:20 +0000 (+0300) Subject: Bluetooth: Fix hci_sock_recvmsg when MSG_TRUNC is not set X-Git-Tag: v4.9.8~1440^2~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f34228b67246ae3b3ab1dc33b980c77c0650ef4;p=platform%2Fkernel%2Flinux-rpi3.git Bluetooth: Fix hci_sock_recvmsg when MSG_TRUNC is not set Similar to bt_sock_recvmsg MSG_TRUNC shall be checked using the original flags not msg_flags. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 6ef8a01..96f04b7 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -1091,7 +1091,7 @@ static int hci_sock_recvmsg(struct socket *sock, struct msghdr *msg, skb_free_datagram(sk, skb); - if (msg->msg_flags & MSG_TRUNC) + if (flags & MSG_TRUNC) copied = skblen; return err ? : copied;