summaryrefslogtreecommitdiff
path: root/net/bluetooth/hci_debugfs.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-07-03 15:44:33 +0100
committerMark Brown <broonie@kernel.org>2026-07-03 15:44:33 +0100
commit53079182b2ff074d87a56da47fd781849a6b2652 (patch)
tree8bea77480130b18bed9875c31d6dda8bd76b3a6d /net/bluetooth/hci_debugfs.c
parente0ef27d451779585b22e79c1f0e6b96cb464f806 (diff)
parent7ea67149af719895ddf003cb8e9d2b287ef0a223 (diff)
downloadlinux-next-53079182b2ff074d87a56da47fd781849a6b2652.tar.gz
linux-next-53079182b2ff074d87a56da47fd781849a6b2652.zip
Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
Diffstat (limited to 'net/bluetooth/hci_debugfs.c')
-rw-r--r--net/bluetooth/hci_debugfs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/bluetooth/hci_debugfs.c b/net/bluetooth/hci_debugfs.c
index 0635e4641db4..aadffaaff20e 100644
--- a/net/bluetooth/hci_debugfs.c
+++ b/net/bluetooth/hci_debugfs.c
@@ -1161,16 +1161,12 @@ static ssize_t force_no_mitm_write(struct file *file,
size_t count, loff_t *ppos)
{
struct hci_dev *hdev = file->private_data;
- char buf[32];
- size_t buf_size = min(count, (sizeof(buf) - 1));
bool enable;
+ int err;
- if (copy_from_user(buf, user_buf, buf_size))
- return -EFAULT;
-
- buf[buf_size] = '\0';
- if (kstrtobool(buf, &enable))
- return -EINVAL;
+ err = kstrtobool_from_user(user_buf, count, &enable);
+ if (err)
+ return err;
if (enable == hci_dev_test_flag(hdev, HCI_FORCE_NO_MITM))
return -EALREADY;