Context |
Check |
Description |
tedd_an/pre-ci_am |
success
|
Success
|
tedd_an/CheckPatch |
warning
|
WARNING: Co-developed-by: must be immediately followed by Signed-off-by:
#82:
Co-developed-by: Sean Wang <sean.wang@mediatek.com>
---
total: 0 errors, 1 warnings, 30 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13309551.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
|
tedd_an/GitLint |
success
|
Gitlint PASS
|
tedd_an/SubjectPrefix |
success
|
Gitlint PASS
|
tedd_an/BuildKernel |
success
|
BuildKernel PASS
|
tedd_an/CheckAllWarning |
success
|
CheckAllWarning PASS
|
tedd_an/CheckSparse |
success
|
CheckSparse PASS
|
tedd_an/CheckSmatch |
success
|
CheckSparse PASS
|
tedd_an/BuildKernel32 |
success
|
BuildKernel32 PASS
|
tedd_an/TestRunnerSetup |
success
|
TestRunnerSetup PASS
|
tedd_an/TestRunner_l2cap-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_iso-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_bnep-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_mgmt-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_rfcomm-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_sco-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_ioctl-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_mesh-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_smp-tester |
success
|
TestRunner PASS
|
tedd_an/TestRunner_userchan-tester |
success
|
TestRunner PASS
|
tedd_an/IncrementalBuild |
success
|
Incremental Build PASS
|
@@ -370,7 +370,7 @@ EXPORT_SYMBOL_GPL(btmtk_register_coredump);
int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
{
struct btmediatek_data *data = hci_get_priv(hdev);
- int err;
+ int err, offset;
if (!IS_ENABLED(CONFIG_DEV_COREDUMP))
return 0;
@@ -392,15 +392,15 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
if (err < 0)
break;
data->cd_info.cnt++;
+ offset = skb->len - sizeof(MTK_COREDUMP_END);
/* Mediatek coredump data would be more than MTK_COREDUMP_NUM */
- if (data->cd_info.cnt > MTK_COREDUMP_NUM &&
- skb->len > sizeof(MTK_COREDUMP_END) &&
- !memcmp((char *)&skb->data[skb->len - sizeof(MTK_COREDUMP_END)],
- MTK_COREDUMP_END, sizeof(MTK_COREDUMP_END) - 1)) {
- bt_dev_info(hdev, "Mediatek coredump end");
- hci_devcd_complete(hdev);
- }
+ if (data->cd_info.cnt > MTK_COREDUMP_NUM && offset > 0)
+ if (!memcmp((char *)&skb->data[offset], MTK_COREDUMP_END,
+ sizeof(MTK_COREDUMP_END) - 1)) {
+ bt_dev_info(hdev, "Mediatek coredump end");
+ hci_devcd_complete(hdev);
+ }
break;
}
There may be a potential null pointer risk if offset value is less than 0 when doing memcmp in btmtk_process_coredump(). Checking offset is valid before doing memcmp. Signed-off-by: Chris Lu <chris.lu@mediatek.com> Co-developed-by: Sean Wang <sean.wang@mediatek.com> --- v2: fix typo --- drivers/bluetooth/btmtk.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)