-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluetooth: A2DP: Fix NULL pointer references issue #75367
Bluetooth: A2DP: Fix NULL pointer references issue #75367
Conversation
The opposite logic is used to determine if a pointer is valid. Correct the judgment logic. Fixes #74728. Signed-off-by: Lyle Zhu <[email protected]>
I think the more worrying thing here is that it seems this code was never tested. Otherwise you'd get NULL dereferences immediately. |
Indeed. BSIM can't test BREDR right? So for classic we should probably start implementing/requesting unit tests at the very least. |
Yep. One alternative to explore for runtime testing, would be to use the BlueZ btvirt tool to create multiple virtual dual-mode controllers. btvirt makes the controllers "reachable" to each other, so you'd start one qemu instance per controller and then set one as connectable + discoverable and another to then try to connect to the first one and do some A2DP or other Bluetooth Classic protocol communication between them. That's a rather big effort of its own, but if @lylezhu2012 or anyone else with a stake in Bluetooth Classic is interested it might be the shortest path to get some runtime testing in our CI. |
Cool We should at least look for some useful approach for testing classic in CI, otherwise it'll just end up broken periodically. Adding support for it in BSIM would probably be ideal - Then we could also start working towards some dual-mode tests, but I assume that's also a significant effort right @aescolar ? |
Yes. In the short term, I hope to enable pts test, which is what I am doing. In this way, we can ensure the most basic quality. Then, we plan implement BSIM-like testing based on twister. |
Correct. Classic BT is not currently supported, and there is no plans for it, and I doubt Nordic will have a motivation to pay for that development :) |
The opposite logic is used to determine if a pointer is valid.
Correct the judgement logic.
Fixes #74728.