projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98b5798
)
Bluetooth: btrtl: Fix a error code in rtl_load_config()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Fri, 28 Jul 2017 14:41:11 +0000
(17:41 +0300)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Fri, 28 Jul 2017 16:29:08 +0000
(19:29 +0300)
We accidentally return success if the kmemdup() fails. It results in
a NULL dereference in the caller.
Fixes:
1110a2dbe698
("Bluetooth: btrtl: Add RTL8822BE Bluetooth device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/btrtl.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/bluetooth/btrtl.c
b/drivers/bluetooth/btrtl.c
index 8279094dd713bf8b03d0403e2ebee77313bcde3c..d9a99b4302ea767d8896ee06c55d01b2050aa29a 100644
(file)
--- a/
drivers/bluetooth/btrtl.c
+++ b/
drivers/bluetooth/btrtl.c
@@
-279,6
+279,8
@@
static int rtl_load_config(struct hci_dev *hdev, const char *name, u8 **buff)
return ret;
ret = fw->size;
*buff = kmemdup(fw->data, ret, GFP_KERNEL);
+ if (!*buff)
+ ret = -ENOMEM;
release_firmware(fw);