Skip to content

Commit 0fd7b2a

Browse files
committed
Merge tag 'for-net-2025-02-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - mgmt: Check return of mgmt_alloc_skb - btusb: Initialize .owner field of force_poll_sync_fops * tag 'for-net-2025-02-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: Add check for mgmt_alloc_skb() in mgmt_device_connected() Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name() bluetooth: btusb: Initialize .owner field of force_poll_sync_fops ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 00371a3 + d8df010 commit 0fd7b2a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/bluetooth/btusb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,7 @@ static ssize_t force_poll_sync_write(struct file *file,
36443644
}
36453645

36463646
static const struct file_operations force_poll_sync_fops = {
3647+
.owner = THIS_MODULE,
36473648
.open = simple_open,
36483649
.read = force_poll_sync_read,
36493650
.write = force_poll_sync_write,

net/bluetooth/mgmt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9660,6 +9660,9 @@ void mgmt_device_connected(struct hci_dev *hdev, struct hci_conn *conn,
96609660
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0) +
96619661
eir_precalc_len(sizeof(conn->dev_class)));
96629662

9663+
if (!skb)
9664+
return;
9665+
96639666
ev = skb_put(skb, sizeof(*ev));
96649667
bacpy(&ev->addr.bdaddr, &conn->dst);
96659668
ev->addr.type = link_to_bdaddr(conn->type, conn->dst_type);
@@ -10413,6 +10416,8 @@ void mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1041310416

1041410417
skb = mgmt_alloc_skb(hdev, MGMT_EV_DEVICE_FOUND,
1041510418
sizeof(*ev) + (name ? eir_precalc_len(name_len) : 0));
10419+
if (!skb)
10420+
return;
1041610421

1041710422
ev = skb_put(skb, sizeof(*ev));
1041810423
bacpy(&ev->addr.bdaddr, bdaddr);

0 commit comments

Comments
 (0)