From cbd217d5b167a478d9080e503a830528d77bb7a6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 25 Aug 2023 09:59:27 -0400 Subject: [PATCH] MT#55283 fix for NULL selected_sfd Fixes possible NULL dereference as selected_sfd can be NULL. Fixes #1710 Change-Id: Ie9208d41e32278c52bec8c820435539c82343c28 --- daemon/media_socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/media_socket.c b/daemon/media_socket.c index e535861d06..cf704dbfec 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -53,7 +53,8 @@ else \ diff_ ## x ## _ ## io = (ke)->x - ks_val; \ atomic64_add(&ps->stats_ ## io.x, diff_ ## x ## _ ## io); \ - atomic64_add(&ps->selected_sfd->local_intf->stats.io.x, diff_ ## x ## _ ## io); \ + if (ps->selected_sfd) \ + atomic64_add(&ps->selected_sfd->local_intf->stats.io.x, diff_ ## x ## _ ## io); \ RTPE_STATS_ADD(x ## _kernel, diff_ ## x ## _ ## io); \ } while (0)