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:
parent
876f435b63
commit
fe324483b4
|
|
@ -321,7 +321,7 @@ void mxc_enable_gis(void)
|
|||
|
||||
gis_running = false;
|
||||
|
||||
if (!strcmp(gis_input, "vadc")) {
|
||||
if (gis_input != NULL && !strcmp(gis_input, "vadc")) {
|
||||
printf("gis input --- vadc\n");
|
||||
/* vadc_in 0 */
|
||||
vadc_config(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue