mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-19 12:49:10 +08:00
Bluetooth: Add check for mgmt_alloc_skb() in mgmt_device_connected()
Add check for the return value of mgmt_alloc_skb() in
mgmt_device_connected() to prevent null pointer dereference.
Fixes: e96741437e ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
committed by
Luiz Augusto von Dentz
parent
f2176a07e7
commit
d8df010f72
@@ -9660,6 +9660,9 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
|
||||
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0) +
|
||||
eir_precalc_len(sizeof(conn->dev_class)));
|
||||
|
||||
if (!skb)
|
||||
return;
|
||||
|
||||
ev = skb_put(skb, sizeof(*ev));
|
||||
bacpy(&ev->addr.bdaddr, &conn->dst);
|
||||
ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
|
||||
|
||||
Reference in New Issue
Block a user