diff mbox series

Bluetooth: btintel: Fix incorrect out of memory check

Message ID 20210909123541.34779-1-colin.king@canonical.com (mailing list archive)
State Accepted
Headers show
Series Bluetooth: btintel: Fix incorrect out of memory check | expand

Commit Message

Colin King Sept. 9, 2021, 12:35 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Currently *ven_data is being assigned the return from a kmalloc call but
the out-of-memory check is checking ven_data and not *ven_data. Fix this
by adding the missing dereference * operator,

Addresses-Coverity: ("Dereference null return")
Fixes: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/bluetooth/btintel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Sept. 9, 2021, 1:26 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=544373

---Test result---

Test Summary:
CheckPatch                    FAIL      0.64 seconds
GitLint                       FAIL      0.14 seconds
BuildKernel                   PASS      689.41 seconds
TestRunner: Setup             PASS      449.90 seconds
TestRunner: l2cap-tester      PASS      3.36 seconds
TestRunner: bnep-tester       PASS      2.18 seconds
TestRunner: mgmt-tester       FAIL      35.32 seconds
TestRunner: rfcomm-tester     PASS      2.49 seconds
TestRunner: sco-tester        PASS      2.49 seconds
TestRunner: smp-tester        PASS      2.54 seconds
TestRunner: userchan-tester   PASS      2.24 seconds

Details
##############################
Test: CheckPatch - FAIL - 0.64 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
Bluetooth: btintel: Fix incorrect out of memory check
WARNING: Unknown commit id '70dd978952bc', maybe rebased or not pulled?
#11: 
Fixes: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")

total: 0 errors, 1 warnings, 8 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.

"[PATCH] Bluetooth: btintel: Fix incorrect out of memory check" has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL - 0.14 seconds
Run gitlint with rule in .gitlint
Bluetooth: btintel: Fix incorrect out of memory check
8: B1 Line exceeds max length (88>80): "Fixes: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")"


##############################
Test: BuildKernel - PASS - 689.41 seconds
Build Kernel with minimal configuration supports Bluetooth


##############################
Test: TestRunner: Setup - PASS - 449.90 seconds
Setup environment for running Test Runner


##############################
Test: TestRunner: l2cap-tester - PASS - 3.36 seconds
Run test-runner with l2cap-tester
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: bnep-tester - PASS - 2.18 seconds
Run test-runner with bnep-tester
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: mgmt-tester - FAIL - 35.32 seconds
Run test-runner with mgmt-tester
Total: 452, Passed: 451 (99.8%), Failed: 1, Not Run: 0

Failed Test Cases
Read Exp Feature - Success                           Failed       0.018 seconds

##############################
Test: TestRunner: rfcomm-tester - PASS - 2.49 seconds
Run test-runner with rfcomm-tester
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: sco-tester - PASS - 2.49 seconds
Run test-runner with sco-tester
Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: smp-tester - PASS - 2.54 seconds
Run test-runner with smp-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: TestRunner: userchan-tester - PASS - 2.24 seconds
Run test-runner with userchan-tester
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth
Marcel Holtmann Sept. 10, 2021, 7:29 a.m. UTC | #2
Hi Colin,

> Currently *ven_data is being assigned the return from a kmalloc call but
> the out-of-memory check is checking ven_data and not *ven_data. Fix this
> by adding the missing dereference * operator,
> 
> Addresses-Coverity: ("Dereference null return")
> Fixes: 70dd978952bc ("Bluetooth: btintel: Define a callback to fetch codec config data")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/bluetooth/btintel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel
diff mbox series

Patch

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 115bb2d07a8d..9359bff47296 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -2176,7 +2176,7 @@  static int btintel_get_codec_config_data(struct hci_dev *hdev,
 	}
 
 	*ven_data = kmalloc(sizeof(__u8), GFP_KERNEL);
-	if (!ven_data) {
+	if (!*ven_data) {
 		err = -ENOMEM;
 		goto error;
 	}