Skip to content
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

bt_le_adv_stop null pointer exception #44480

Closed
JoeEtacompute opened this issue Apr 2, 2022 · 1 comment · Fixed by #44591
Closed

bt_le_adv_stop null pointer exception #44480

JoeEtacompute opened this issue Apr 2, 2022 · 1 comment · Fixed by #44591
Assignees
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.

Comments

@JoeEtacompute
Copy link

JoeEtacompute commented Apr 2, 2022

Describe the bug
In subsys/bluetooth/host/adv.c .Move null pointer check to before calling bt_le_lim_adv_cancel_timeout.

Original Code

int bt_le_adv_stop(void)
{
        struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy();
        int err;

        (void)bt_le_lim_adv_cancel_timeout(adv);

        if (!adv) {
                BT_ERR("No valid legacy adv");
                return 0;
        }

Suggested modification:

int bt_le_adv_stop(void)
{
        struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy();
        int err;

       if (!adv) {
                BT_ERR("No valid legacy adv");
                return 0;
        }
        (void)bt_le_lim_adv_cancel_timeout(adv);
}
@JoeEtacompute JoeEtacompute added the bug The issue is a bug, or the PR is fixing a bug label Apr 2, 2022
@carlescufi
Copy link
Member

@JoeEtacompute thanks for the report. Would you mind opening a Pull Request with your suggested change?

@carlescufi carlescufi added area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) labels Apr 4, 2022
@mbolivar-nordic mbolivar-nordic added the priority: low Low impact/importance bug label Apr 5, 2022
@carlescufi carlescufi added the Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc. label Apr 6, 2022
jori-nordic added a commit to jori-nordic/zephyr that referenced this issue Apr 6, 2022
bt_le_lim_adv_cancel_timeout(adv) de-references adv.
Reported by zephyrproject-rtos#44480.

Signed-off-by: Jonathan Rico <[email protected]>
carlescufi pushed a commit that referenced this issue Apr 7, 2022
bt_le_lim_adv_cancel_timeout(adv) de-references adv.
Reported by #44480.

Signed-off-by: Jonathan Rico <[email protected]>
coreboot-bot pushed a commit to coreboot/zephyr-cros that referenced this issue Apr 8, 2022
bt_le_lim_adv_cancel_timeout(adv) de-references adv.
Reported by zephyrproject-rtos/zephyr#44480.

Signed-off-by: Jonathan Rico <[email protected]>
GitOrigin-RevId: ef2e31a
Change-Id: I8e576995438f4cdd9be6b532f1171a963c7e08c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/3578973
Tested-by: CopyBot Service Account <[email protected]>
Reviewed-by: Tristan Honscheid <[email protected]>
Commit-Queue: Tristan Honscheid <[email protected]>
Tested-by: Tristan Honscheid <[email protected]>
pirun pushed a commit to pirun/sdk-zephyr that referenced this issue Jun 2, 2022
bt_le_lim_adv_cancel_timeout(adv) de-references adv.
Reported by zephyrproject-rtos/zephyr#44480.

Signed-off-by: Jonathan Rico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug Trivial Changes that can be reviewed by anyone, i.e. doc changes, minor build system tweaks, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants