From 33683bf92bbad49036b11604e6ee2a750591ddac Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 15 Feb 2017 16:57:20 -0800 Subject: [PATCH] Review radio metadata allocations/deallocations. Bug: b/34054813 Test: VTS, manual Change-Id: I1cbd7baf5b852cd3d4cab374eb67289f3938fff3 --- modules/radio/radio_hw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/radio/radio_hw.c b/modules/radio/radio_hw.c index 150d173d..54707d52 100644 --- a/modules/radio/radio_hw.c +++ b/modules/radio/radio_hw.c @@ -613,7 +613,12 @@ static int tuner_get_program_information(const struct radio_tuner *tuner, metadata = info->metadata; *info = stub_tuner->program; info->metadata = metadata; - if (metadata != NULL && stub_tuner->program.metadata != NULL) + if (metadata == NULL) { + ALOGE("%s metadata is a nullptr", __func__); + status = -EINVAL; + goto exit; + } + if (stub_tuner->program.metadata != NULL) radio_metadata_add_metadata(&info->metadata, stub_tuner->program.metadata); exit: