MLK-20240-3 gis: Add NULL pointer check

Fix coverity issue CID 3768406: Dereference null return value (NULL_RETURNS)
dereference: Dereferencing a pointer that might be NULL gis_input when calling strcmp.

The gis_input may returns NULL from env_get, need check it before strcmp.

Signed-off-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
Ye Li 2018-11-12 01:16:37 -08:00
parent 876f435b63
commit fe324483b4
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ void mxc_enable_gis(void)
gis_running = false; gis_running = false;
if (!strcmp(gis_input, "vadc")) { if (gis_input != NULL && !strcmp(gis_input, "vadc")) {
printf("gis input --- vadc\n"); printf("gis input --- vadc\n");
/* vadc_in 0 */ /* vadc_in 0 */
vadc_config(0); vadc_config(0);