hal: kw fix for address pntr check in auto hal

KW fix for address pointer check before usage
in auto HAL.

Signed-off-by: E V Ravi <evenka@codeaurora.org>
Change-Id: I9b658a86e6f3bd9ee460af1f6bdb58de08842740
This commit is contained in:
Viraja Kommaraju 2019-09-09 19:51:24 +05:30 committed by Derek Chen
parent 7a2f2c0669
commit 8987cd7a5d
1 changed files with 10 additions and 10 deletions

20
hal/audio_extn/auto_hal.c Executable file → Normal file
View File

@ -158,11 +158,11 @@ int auto_hal_create_audio_patch(struct audio_hw_device *dev,
sources->ext.device.address);
} else {
address = (char *)calloc(1, 1);
if (address == NULL) {
ALOGE("%s: failed to get address",__func__);
ret = -EFAULT;
goto error;
}
}
if (address == NULL) {
ALOGE("%s: failed to get address",__func__);
ret = -EFAULT;
goto exit;
}
parms = str_parms_create_str(address);
if (!parms) {
@ -197,11 +197,11 @@ int auto_hal_create_audio_patch(struct audio_hw_device *dev,
sinks->ext.device.address);
} else {
address = (char *)calloc(1, 1);
if (address == NULL) {
ALOGE("%s: failed to get address",__func__);
ret = -EFAULT;
goto error;
}
}
if (address == NULL) {
ALOGE("%s: failed to get address",__func__);
ret = -EFAULT;
goto exit;
}
parms = str_parms_create_str(address);
if (!parms) {