提交 c3327bde 编写于 作者: D Dan Carpenter 提交者: Johan Hedberg

Bluetooth: btrtl: Fix a error code in rtl_load_config()

We accidentally return success if the kmemdup() fails.  It results in
a NULL dereference in the caller.

Fixes: 1110a2db ("Bluetooth: btrtl: Add RTL8822BE Bluetooth device")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 98b57984
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册