mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name()
Add check for the return value of mgmt_alloc_skb() in
mgmt_remote_name() to prevent null pointer dereference.
Fixes: ba17bb62ce ("Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_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:
parent
cbf85b9cb8
commit
f2176a07e7
|
|
@ -10413,6 +10413,8 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
|
|||
|
||||
skb = mgmt_alloc_skb(hdev, MGMT_EV_DEVICE_FOUND,
|
||||
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0));
|
||||
if (!skb)
|
||||
return;
|
||||
|
||||
ev = skb_put(skb, sizeof(*ev));
|
||||
bacpy(&ev->addr.bdaddr, bdaddr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user