* [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op()
@ 2024-06-27 8:56 Roman Smirnov
2024-06-27 10:43 ` [BlueZ] " bluez.test.bot
2024-06-27 18:32 ` [PATCH BlueZ] " Luiz Augusto von Dentz
0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-27 8:56 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Roman Smirnov
This prevents a null pointer from being dereferenced in case
queue_find() returns NULL.
---
src/shared/bass.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/bass.c b/src/shared/bass.c
index c30537dee..f08799714 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -875,7 +875,8 @@ static void bass_handle_add_src_op(struct bt_bass *bass,
attr);
queue_remove(bass->ldb->bcast_srcs, src);
- bass_bcast_src_free(src);
+ if (src)
+ bass_bcast_src_free(src);
bcast_src->attr = attr;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ] bass: add NULL check to bass_handle_add_src_op()
2024-06-27 8:56 [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op() Roman Smirnov
@ 2024-06-27 10:43 ` bluez.test.bot
2024-06-27 18:32 ` [PATCH BlueZ] " Luiz Augusto von Dentz
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-06-27 10:43 UTC (permalink / raw)
To: linux-bluetooth, r.smirnov
[-- Attachment #1: Type: text/plain, Size: 949 bytes --]
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=866057
---Test result---
Test Summary:
CheckPatch PASS 0.44 seconds
GitLint PASS 0.31 seconds
BuildEll PASS 24.85 seconds
BluezMake PASS 1724.51 seconds
MakeCheck PASS 13.36 seconds
MakeDistcheck PASS 176.79 seconds
CheckValgrind PASS 257.68 seconds
CheckSmatch PASS 356.20 seconds
bluezmakeextell PASS 119.07 seconds
IncrementalBuild PASS 1575.96 seconds
ScanBuild PASS 1008.74 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op()
2024-06-27 8:56 [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op() Roman Smirnov
2024-06-27 10:43 ` [BlueZ] " bluez.test.bot
@ 2024-06-27 18:32 ` Luiz Augusto von Dentz
1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-06-27 18:32 UTC (permalink / raw)
To: Roman Smirnov; +Cc: linux-bluetooth
Hi Roman,
On Thu, Jun 27, 2024 at 5:00 AM Roman Smirnov <r.smirnov@omp.ru> wrote:
>
> This prevents a null pointer from being dereferenced in case
> queue_find() returns NULL.
> ---
> src/shared/bass.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/shared/bass.c b/src/shared/bass.c
> index c30537dee..f08799714 100644
> --- a/src/shared/bass.c
> +++ b/src/shared/bass.c
> @@ -875,7 +875,8 @@ static void bass_handle_add_src_op(struct bt_bass *bass,
> attr);
>
> queue_remove(bass->ldb->bcast_srcs, src);
> - bass_bcast_src_free(src);
> + if (src)
> + bass_bcast_src_free(src);
I'd move this check inside bass_bcast_src_free to make it safe to pass
NULL pointers.
> bcast_src->attr = attr;
> }
>
> --
> 2.43.0
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-27 18:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 8:56 [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op() Roman Smirnov
2024-06-27 10:43 ` [BlueZ] " bluez.test.bot
2024-06-27 18:32 ` [PATCH BlueZ] " Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox