From d7a6390344ad7f0f2aad1f5d6b7b55accf5761ff Mon Sep 17 00:00:00 2001 From: Tanya Dixit Date: Wed, 17 Oct 2018 17:20:04 +0530 Subject: [PATCH] soc: Add proper null check for client array pointer Check if snd event client array is null before dereferencing. CRs-Fixed: 2328286 Change-Id: I4f7c2a1288ee27df51609e090cb2da2d33624a07 Signed-off-by: Tanya Dixit --- soc/snd_event.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/soc/snd_event.c b/soc/snd_event.c index 32407742b2a2..f8bffb81c2e4 100644 --- a/soc/snd_event.c +++ b/soc/snd_event.c @@ -301,6 +301,10 @@ void snd_event_mstr_add_client(struct snd_event_clients **snd_clients, } client->cl_arr = kzalloc(sizeof(struct snd_event_client_array), GFP_KERNEL); + if (!client->cl_arr) { + *snd_clients = ERR_PTR(-ENOMEM); + return; + } *snd_clients = client; } else { struct snd_event_client_array *new;