Check if snd event client array is null before dereferencing. CRs-Fixed: 2328286 Change-Id: I4f7c2a1288ee27df51609e090cb2da2d33624a07 Signed-off-by: Tanya Dixit <[email protected]>
@@ -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;