Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 15 Feb 2022 01:59:38 +0000 (17:59 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 16 Feb 2022 10:25:36 +0000 (11:25 +0100)
commit8abc7824203217c23de0e513b2a9505d0f9a0603
tree27b8cf92f4790c8642d6e6a13d0a033d4e8d9359
parent04811bcfd4224be1d742564f363eb19581451d57
Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks

Since bt_skb_sendmmsg can be used with the likes of SOCK_STREAM it
shall return the partial chunks it could allocate instead of freeing
everything as otherwise it can cause problems like bellow.

Fixes: 81be03e026dc ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Link: https://lore.kernel.org/r/d7206e12-1b99-c3be-84f4-df22af427ef5@molgen.mpg.de
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215594
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de> (Nokia N9 (MeeGo/Harmattan)
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/bluetooth.h